The decision to buy the Saab jet over Boeing's F-18 Super Hornet or France's Dassault Rafale came as a surprise to many. Some analysts said Boeing's bid was hurt by reports that the U.S. conducted extensive spying in Brazil, including a direct targeting of President Dilma Rousseff's own communications.

Brazil wants the jets to ramp up its defense capabilities to patrol a porous land border that's more than 9,300 miles (15,000 kilometers) long, much of it covered by jungle, over which arms and drugs easily flow. Brazil also seeks better protection for offshore oil fields it has discovered in recent years.

Defense Minister Celso Amorim said the choice after some 15 years of debate was made following "careful study and consideration, taking into account performance, transfer of technology and cost, not just of acquisition but of maintenance."

Swedish Foreign Minister Carl Bildt went on Twitter to call the decision "a tribute to Swedish technology and competitiveness."

Many had expected the choice to be between the Boeing and French planes. Former Brazilian President Luiz Inacio Lula da Silva had favored the Dassault Rafale, while Rousseff was said to favor the F-18.

Revelations six months ago that the U.S. National Security Agency's mammoth espionage program included widespread spying on Brazil was likely a factor in Saab being chosen, some analysts said. Brazilian anger over the spying led Rousseff to cancel a planned state visit to Washington in October.

"Dilma had been favoring the Boeing plane and a lot of people thought she would announce her decision during her state visit to Washington," said David Fleischer, a political scientist at the University of Brasilia. "Boeing was very close, but then the NSA booted them out of the air."

Carl Meacham, director of the Americas program at the Washington-based Center for Strategic and International Studies, said the NSA stories made it politically impossible for Rousseff to go with Boeing and the decision will be another blow to U.S-Brazilian relations that already "are at a significant low."

Alexandre Barros, a political risk consultant with the Brasilia-based firm Early Warning, disagreed the NSA was a big factor. The Swedish jet was favored by Brazil's air force, according to an internal assessment leaked to the newspaper Folha de S.Paulo in 2010, and Barros said it was always going to win the competition.

He said many in the government long opposed Boeing because the company's bid was less flexible in terms of technology transfers than the two European plane makers and also because they were wary of becoming indebted to Washington.

"The Americans tend to think that if you buy arms from them you are automatically their allies," Barros said. "Brazil doesn't want that kind of link."

He said that as South America's main power, Brazil doesn't want to be in the position of being perceived as having to support American policies on the continent. Part of the draw of Saab's bid was that Sweden doesn't have any political clout in the region.

Brazil's military hopes the purchase decision after years of debate will lead to advances in its defense capabilities.

The country had the largest defense industry in the developing world in the mid-1980s. It was the world's eighth-largest arms exporter with strong demand for its armored personnel carriers, reconnaissance and anti-aircraft vehicles, troop carriers and rocket launchers.

However, the industry went into a tailspin when the Cold War ended and demand for weapons declined. In 1990, Brazil's two largest arms manufacturers, Engesa and Avibras, sought protection from creditors for debts of about $200 million.

___

Associated Press writers Jenny Barchfield in Rio de Janeiro, Karl Ritter in Stockholm and Stan Lehman in Sao Paulo contributed to this report.

Copyright 2013 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.