WASHINGTON (Reuters) - A small Chinese company sued President Barack Obama for squashing its wind farm projects that were close to a military training site, saying the president overstepped his bounds and the law, according to court documents made public on Tuesday.

Ralls Corp said when Obama ordered the company last week to divest its projects due to national security risks, he exceeded his power by dictating the terms of the sale, allowing the government to inspect all aspects of its operations and not treating the company equally as required under the law.

The lawsuit comes in the final weeks of the U.S. presidential campaign, during which Obama's Republican rival, Mitt Romney, has accused the president of not pushing back against China's trade and investment practices.

Ralls Corp, which is owned by two Chinese nationals, initially sued the Committee on Foreign Investment in the United States (CFIUS) in September for ordering the company to temporarily halt operations while the committee completed its probe and made its recommendation to Obama.

The company's chances of winning the lawsuit are slim given the president's broad authority on national security matters.

"It is going to be a tough battle," said Josh Zive, a lawyer with Bracewell & Giuliani who has handled CFIUS cases for 10 years. Zive said the courts tend to stay away from second guessing the executive branch on national security issues. "There is a large amount of discretion given not only to agencies, but in the context of national security, that will make it difficult to win."

Obama issued the rare presidential order on Friday saying there was credible evidence that led him to believe that Ralls Corp and the Chinese Sany Group executives that own the company might take action that poses a risk to U.S. security.

(Reporting By Rachelle Younglai; Editing by Doina Chiacu)

Also on HuffPost:

Loading Slideshow...
  • The blades of turbines on a wind farm catch the wind 10 August 2007 in front of Aegean Sea on Evia island, off the eastern coast of Greece. Under pressure from the European Union and the terms of the Kyoto Protocol to cut its current reliance on lignite (brown coal) for energy production, Greece has green-lighted several wind farm projects since January. The wind farms are expected to reduce a national energy deficit that currently forces Greece to import electricity from neighbouring countries, mainly Bulgaria and the Former Yugoslav Republic of Macedonia, according to a recent report by the state Regulatory Authority for Energy (RAE). ARIS MESSINIS/AFP/GettyImages

  • WITTINGEN, GERMANY - APRIL 23: A modern, electricity-producing wind turbine (L) spins near an old and defunct windmill next to a country road on April 23, 2012 near Wittingen, Germany. Germany is investing heavily in renewable energy sources and has hundreds of wind farms across the country. (Photo by Sean Gallup/Getty Images)

  • View of a wind turbine near Kisielice in northern Poland, on June 23, 2011. In Poland's historic Gdansk Shipyard, the winds of change are blowing again. Now, the 1980 birthplace of the Solidarity freedom movement which peacefully toppled communism in Poland in 1989 is aiming to spin profits from Europe's green energy revolution by building on and offshore wind turbine towers. JANEK SKARZYNSKI/AFP/Getty Images

  • Wind turbines operate near a barley field in the town of Feldheim, Brandenburg, June 20, 2011. Energiequelle GmbH and the 145 residents of Feldheim, a so-called ' energy independent' community, have endeavored to break free from fossil fuel, with a mix of renewable resources--wind, biogas, and solar, and have created their own heat and electricity networks. JOHN MACDOUGALL/AFP/Getty Images

  • SIEBENHAUSEN, GERMANY - AUGUST 20: Wind turbines spin to produce electricity on August 20, 2010 in Siebenhausen near Bitterfeld, Germany. Germany is investing heavily in renewable energy production, including wind power and solar, and is seeking to produce 30% of its electricity nationwide with renewables by 2020. (Photo by Andreas Rentz/Getty Images)

  • SELBY, ENGLAND - AUGUST 24: Recently installed wind turbines generate electricty in the shadow of Drax, Europe's biggest coal fired power station, on August 24, 2010 in Selby, England. The Rusholme wind farm will create 24 Mega Watts when fully operational in comparison to Drax which creates 3,960 Mega Watts. (Photo by Christopher Furlong/Getty Images)

  • SELBY, ENGLAND - AUGUST 24: Recently installed wind turbines generate electricty in the shadow of Drax, Europe's biggest coal fired power station, on August 24, 2010 in Selby, England. The Rusholme wind farm will create 24 Mega Watts when fully operational in comparison to Drax which creates 3,960 Mega Watts. (Photo by Christopher Furlong/Getty Images)

  • This picture taken on August 25, 2010 shows a windfarm on the outskirts of Beijing. China has leapfrogged the United States to become the most attractive market for renewable investment this year, says global accounting firm Ernst & Young in a report published in September and is the most attractive market for investment in wind power after Beijing announced plans to launch 90,000 mega-watts of wind capacity by 2015, the report said. PETER PARKS/AFP/Getty Images

  • Wind turbines are pictured in the village of Patirnico, a village between Palermo and Trapani, on September 15, 2010. The seizure of a record 1.5 billion euros from a Sicilian businessman known as 'Lord of the Wind' on the same day has put the spotlight on Mafia money-laundering through renewable energy ventures. MARCELLO PATERNOSTRO/AFP/Getty Images

  • This photo taken on October 29, 2010 shows wind turbines in the Ngong hills, some 25 kms south-west of Nairobi, which are owned and run by Kenya's main power generating company KENGEN. The majority of Kenyans are unwilling to abandon their traditional energy sources in favour of cleaner or renewable ones unless their incomes rise significantly, a study has found. TONY KARUMBA/AFP/Getty Images

  • This photo taken on October 29, 2010 shows wind turbines in the Ngong hills, some 25 kms south-west of Nairobi, which are owned and run by Kenya's main power generating company KENGEN. The majority of Kenyans are unwilling to abandon their traditional energy sources in favour of cleaner or renewable ones unless their incomes rise significantly, a study has found. TONY KARUMBA/AFP/Getty Images

  • ROEDGEN, GERMANY - AUGUST 20: A combine harvester drives through a wheat field near a wind turbine at sunset on August 20, 2010 in Roedgen near Bitterfeld, Germany. Germany is investing heavily in renewable energy production, including wind power and solar, and is seeking to produce 30% of its electricity nationwide with renewables by 2020. (Photo by Andreas Rentz/Getty Images)

  • PROESITZ, GERMANY - AUGUST 19: Wind turbines spin to produce electricity on August 19, 2010 near Proesitz, Germany. Germany is investing heavily in renewable energy production, including wind power and solar, and is seeking to produce 30% of its electricity nationwide with renewables by 2020. (Photo by Sean Gallup/Getty Images)

  • A picture taken on May 21, 2010 shows a windmill near Saint-Seine l'Abbaye, eastern France. JEFF PACHOUD/AFP/Getty Images

  • A picture taken on May 21, 2010 shows a windmill near Saint-Seine l'Abbaye, eastern France. JEFF PACHOUD/AFP/Getty Images

  • Sheep graze close to electricity generating wind turbines as a rainbow is seen in the background on July, 26 2010 near the northern German town of Husum. JOHANNES EISELE/AFP/Getty Images

  • A man rides a horse next to wind generators in Cogealac, 250km east from Bucharest, on August 2, 2010. Romania's decision to open its wind-power market has triggered fierce competition among investors, several of whom target the Dobroudja region, described by experts as the second-best choice in Europe. DANIEL MIHAILESCU/AFP/Getty Images

  • A Moroccan flag flies next to a wind turbine on June 28, 2010 at a 250-million-euro (300 million US dollar) wind farm near Tangiers shortly after its inauguration by Moroccan King Mohammed VI. The farm in Melloussa, 34 kms (21 miles) from Tangiers in northern Morocco, has 165 turbines, with a production capacity of 140 megawatts. The project was part-financed by the European Bank, which invested 80 million euros, while Spanish and German banks put in a total of 150 million euros. ABDELHAK SENNA/AFP/Getty Images

  • A wind park can be seen as morning breaks in Copenhagen on December 13, 2009. The COP15 climate summit continues with rich countries being asked to raise their pledges on tackling climate change under a draft text of a possible final deal at the Copenhagen summit. AXEL SCHMIDT/AFP/Getty Images

  • A picture taken on November 26, 2009 near Calvi, French Corsica Island, shows wind turbines. JOEL SAGET/AFP/Getty Images

  • In a picture taken on December 10, 2009 wind turbines dot the landscape on the outskirts of Dongying, in central China's Shandong province. The world's major emerging economies led by China are calling for a 'binding' amendment to the Kyoto Protocol requiring rich countries to slash carbon pollution by more than 40 percent compared to 1990, according to a document seen by AFP, as Beijing said in November that by 2020 it would curb emissions per unit of gross domestic product by between 40 and 45 percent compared to 2005 levels. AFP/AFP/Getty Images

  • ROCHDALE, UNITED KINGDOM - NOVEMBER 16: The turbine sails of the Scout Moor Wind Farm in the South Pennines dominate the skyline on November 16, 2009 in Rochdale, United Kingdom. As world leaders prepare to gather for the Copenhagen Climate Summit in December, the resolve of the industrial nations seems to be weakening with President Obama stating that it would be impossible to reach a binding deal at the summit. Climate campaigners are concerned that this disappointing announcement is a backward step ahead of the summit. (Photo by Christopher Furlong/Getty Images)

  • A picture taken on November 5, 2009 shows cars and people passing near wind power turbines in Dali, in the China's southwestern Yunnan province. In energy-hungry China's southwestern Yunnan province, power is being produced at wind farms, dams and garbage dumps as the Asian giant adopts more 'green' technology thanks to carbon trading. LIU JIN/AFP/Getty Images

  • Westmill Wind Farm Co-op, the first onshore wind farm to be built in the south-east of England is pictured in Watchfield near Swindon, on December 5, 2008. The wind farm produces enough green electricity to power more than 2,500 homes whilst saving the emissions of carbon dioxide. ADRIAN DENNIS/AFP/Getty Images

  • PALM SPRINGS, CA - MAY 13: Giant wind turbines are powered by strong prevailing winds on May 13, 2008 near Palm Springs, California. A US government report released this week concludes that wind energy could generate 20 percent of the electricity produced in the US by 2030, as much as is currently provided by nuclear reactors. Although wind energy constitutes only about 1 percent of the electricity of the nation, wind energy is experiencing a growth spurt with an increase of 45 percent jump last year. The report envisions more than 75,000 new wind turbines, many of them bigger than those in use today, and many of them in offshore waters to increase production from the current 16,000 megawatts of power to 300,000 megawatts. The report does not predict that such growth will actually occur but rather that it is possible. (Photo by David McNew/Getty Images)

  • Wyoming's Wind Turbines

    It’s quiet out on the high plains of Wyoming. An ancient silence broken by the gentle sounds of cows lowing, ranchers talking about the day’s work ahead. And the sound of huge propellers starting up, responding to nature’s free and abundant offering: the wind.