The Navy chose Boeing Co. over Lockheed Martin Corp. yesterday for a $3.9 billion contract to provide the military service with aircraft to hunt submarines and track surface ships.

The contract, which covers the development stage, could be worth up to $44 billion over the life of the program. The Navy plans to buy more than 100 of the planes.

Bethesda-based Lockheed Martin was widely expected to win the contract based on its proposal to update its four-engine propeller plane used by the Navy. Instead, the military selected Boeing's plan to modify its twin-engine 737 jet, which the company said could get to hot spots more quickly.

"Lockheed has owned this program for four decades," said John Pike, executive director of Globalsecurity.org. "I would characterize it as an upset."

The contract was a boost for Chicago-based Boeing, which has struggled in the past year with a series of scandals. The Pentagon stalled action on a program to lease and buy Boeing 767 tankers after the company admitted illegally hiring an Air Force official connected to the deal. Also, its space unit has been suspended in an unrelated document-theft case.

The contract is "good news for the company overall because it suggests that they are out of the doghouse with the Pentagon," Pike said.

Boeing said its modified 737 could prove popular overseas with countries that now operate the Lockheed tracking aircraft. "This is a big contract with a lot of potential," said Jim Albaugh, president and chief executive of Boeing's defense unit. "There are a number of countries that are interested around the world."

But industry analysts said the program could fall victim to future budget constraints in the United States. Some of the missions envisioned for the aircraft could be accomplished with cheaper unmanned aerial vehicles, known as drones, which the Navy is also pursuing, the analysts said.

John Young, the Navy's acquisition chief, said the aircraft is still needed because there are diesel submarines that constitute a "very challenging threat for the Navy."

The current fleet, with planes averaging 26 years old, has been increasingly used to track surface vessels and needs to be replaced, he said.

The Navy has already tried to modernize its 1960s fleet of surveillance planes. In the 1980s, the Navy awarded Lockheed a contract to build an updated version of the planes, only to cancel it in 1990 when the program ran over budget and behind schedule, costing Lockheed $300 million.