U.S. and Swedish officials said after meeting here today that they were on the verge of a breakthrough on Sweden's longstanding request to get American engines and missiles for its next fighter plane.

Under a deal agreed upon in principle today, Sweden would get a souped-up version of the General Electric 404 jet engine and advanced Sparrow air-to-air missiles provided this neutral country agreed to tighter restrictions designed to keep the technology from falling into unfriendly hands.

Defense Secretary Caspar W. Weinberger told his Swedish counterpart, Torsten Gustafsson, that such an arrangement would be "in the mutual interest" of the two countries, according to sources involved in the discussions. They added that Gustafsson, in turn, told Weinberger that while the Swedish government believes current export restrictions are adequate, Stockholm would consider tightening them if this would close the airplane deal.

Calling this meeting of minds "significant," one high official in the Weinberger party predicted that there would be a formal agreement on the matter within weeks. It would then go to Congress for review.

Under the plan discussed at length here with Swedish officials by Weinberger, Sweden would produce all or part of the advanced 404 engine for its new fighter plane. The Swedish government has not decided whether to produce the air frame of this plane itself, or buy an American one. Swedish military officials appear to favor building their own, with the U.S. F16 and F18 fighters the leading candidates if a foreign plane is to be purchased.

The missile Swedish officials said they wanted is the highly acclaimed Aim-9L used on American first-line fighters. The Aim-9L can be fired when a fighter plane is running at its adversary head-on. This is a big advantage over other missiles, which require the pilot to maneuver his plane to the side or rear of the enemy to enable the missile to home in on hot engine exhaust.

In fact, some U.S. senators considered the Aim-9L such an advanced weapon that they opposed selling it to Saudi Arabia for fear it would fall into Soviet hands. The missile is part of the Reagan administration's AWACS package sale to the Saudis.

U.S.-Swedish negotiations on the aircraft package were derailed last year when Washington asserted that Sweden had sold to the Soviet Union aircraft ground control equipment that included American parts that were not supposed to be exported. Besides putting those negotiations back on the track, Weinberger's visit was being hailed here as proof of warmer relationships between Stockholm and Washington.

Gustafsson said tonight at a banquet for Weinberger: "It is the first time in the 200 years of our official relations that an American secretary of defense has paid an official visit to Sweden."