The Air Force selected Boeing Co. yesterday to build more than 3,000 air-launched cruise missiles -- a major new strategic nuclear weapon system -- over the next four to five years in a program valued at some $4 billion.

Cruise missiles look like very small pilotless jet planes. Up to 20 could be carried aloft under the wings and in the belly of a single giant B52 bomber and fired at targets up to 1,500 miles away while the B52 stayed outside Soviet air defenses.

In announcing the choice of Boeing over General Dynamics Corp. of San Diego, Air Force Secretary Hans Mark called the new weapon "a significant milestone in the history of the strategic deterrent force."

He said the extremely accurate electronic brain that guides the missile to the target makes it "the first really new strategic weapon that applies a new technology in many, many years." There is "no doubt," he said, that it "will have a very significant effect on the strategic balance."

As prime contractor, Boeing will get the lion's share of the business, estimated by Mark to be worth $1 billion to $2 billion, with the rest parceled out to subcontractors building engines, guidance systems and other components.

The announcement in effect ends 18 months of spirited competition between two of the nation's biggest defense contractors, each with powerful backers in Congress.

Though the history of the program goes back to 1973, and production was planned well in advance of the latest U.S.-Soviet flareup, the contract nevertheless will tend to emphasize the administration's new commitment to higher defense spending and a buildup of military strength.

Yesterday's announcement may prove to be even more significant because it could eventually open the door to building a new plane to carry these missiles. The 173 B52G bombers on which the Pentagon now plans to mount the cruise missiles are the latest model, but they are all at least 18 years old, and the first squadron of these planes will not be fitted with the new weapons until December 1982.

Furthermore, senior administration officials say privately that if relations between the United States and Soviet Union continue to sour and the strategic arms limitation treaty awaiting approval in the Senate is dropped, production of the air-launched cruise missiles could soar.

Some top-secret government estimates of what the U.S. atomic arsenal might look like if the arms control efforts fail include production of more than 10,000 such missiles.

Even if the pending SALT agreement is ratified, these new weapons would be largely unaffected by it, thus giving the U.S. a huge new buildup in nuclear weaponry. Under the SALT arithmetic, the first 120 bombers, even if carrying cruise missiles, still count as only one missile launcher.

The B52s initially will carry six missiles under each wing and then, after modification, eight more in the belly or bomb bay.

When a missile is dropped from a B52, small wings pop out of the body, a small jet engine is ignited and the weapon dives earthward, leveling off at 200 to 600 feet above ground and flying at 500 miles an hour toward the target. This low altitude and its small size make the missiles hard for enemy defense to find and hit, and the large number is meant to overwhelm any defense that is thrown up at them.

The Soviet Union sometime this year is expected to begin deploying a new antiaircraft missile defense known as the SA10. It could cost the Russians billions of dollars to deploy this nationwide but U.S. experts believe it would have very little capability against the cruise missile. Nevertheless, both efforts mark another multi-billion-dollar turn in the arms race.

Aside from Boeing in Seattle, firms sharing in the program include Williams Research Corp. of Walled Lake, Mich., which builds the engine, and McDonnell Douglas of St. Louis, which builds the highly accurate guidance system.

Boeing won after an eight-month fly-off competition with General Dynamics.

Of 10 Boeing flights, six were successful and four crashed. Three of the crashes, the company said, involved failures which only "peripherally" involved the missile itself. General Dynamics also had four crashes out of 10 flights.

Mark said the cost difference between the two firms were not significant and the final judgment was based on better technical performance of the Boeing version. General Dynamics already has been chosen as prime contractor for different versions of the cruise missile to be launched from the ground and from ships.