A Saab JAS 39C Gripen jet performs during an aerial show in Eslov in this June 5, 2011 file photo. Johan Nilsson/TT News Agency/Reuters

Brazil awarded a $4.5 billion contract to Saab AB on Wednesday to replace its aging fleet of fighter jets, a surprise coup for the Swedish company after news of U.S. spying on Brazilians helped derail Boeing's chances for the deal.

The contract, negotiated over the course of three presidencies, will supply Brazil's air force with 36 new Gripen NG fighters by 2020. Aside from the cost of the jets themselves, the agreement is expected to generate billions of additional dollars in future supply and service contracts.

Saab did not immediately comment on the purchase. Sweden's defense minister, Karin Enstrom, said in an interview that the contract, "is a sign that the Gripen is a well-functioning system which is cost efficient."

The timing of the announcement, after more than a decade of off-and-on negotiations, appeared to catch the companies involved by surprise. Even Juniti Saito, Brazil's top air force commander, said Wednesday that he only heard of the decision a day earlier in a meeting with President Dilma Rousseff.

Brazilian officials said the deal, one of the most coveted emerging-market defense contracts, went to Saab because it provided the most affordable option for the new jets, as well as the best conditions for technology transfer to local partners.

The choice, Defense Minister Celso Amorim said, "took into account performance, the effective transfer of technology and costs - not just of acquisition but of maintenance."

Until earlier this year, Boeing's F/A-18 Super Hornet had been considered the front runner. But revelations of spying by the U.S. National Security Agency in Brazil, including personal communication by Rousseff, led Brazil to believe it could not trust a U.S. company.

"The NSA problem ruined it for the Americans," a Brazilian government source said on condition of anonymity.

A U.S. source close to the negotiations said that whatever intelligence the spying had delivered for the American government was unlikely to outweigh the commercial cost of the revelations.

"Was that worth 4 billion dollars?" the source asked.

The lament echo's recent complaints by Cisco Systems Inc, which said in November that a backlash against U.S. government spying contributed to lower demand for its products in China.

In a statement, Boeing called Brazil's decision a "disappointment," but added that it would continue to work with Brazil to meet its defense requirements.

In addition to Chicago-based Boeing Co, France's Dassault Aviation SA was a contender for the contract.

Brazil coexists peacefully with all of its South American neighbors and has no enemies elsewhere. The country, however, is eager to fortify its military as it considers the long-term defense of its vast borders and abundant natural resources, including the Amazon rainforest and offshore oil discoveries.

Under the terms of their agreement, Brazil and Saab will now finalize contract details within a year. The first jet is expected to be delivered two years later, with about 12 of the aircraft expected annually after that.

Saab shares rose 1.84 percent to 133 krona on Wednesday, their highest close in 10 days. Earlier in the day, they rose as much as 5.7 percent to 138 krona, the highest in five months.

Boeing shares fell 0.13 percent to $135.70 in New York, while Dassault Aviation shares fell 0.4 percent to 920 euros in Paris.

Reuters