For the past five years, the Navy has told the Defense Department it does not want any more P3 Orion patrol planes. And every year the Navy still gets more new patrol planes.

This year Navy officials thought they had finally won the battle. The Defense Department, which controls the individual services' budgets, sent its request to Congress without any funds for new Lockheed P3s.

But late last month, Defense Department officials trooped to the Hill and said they had made a mistake. They would like some new P3s after all.

Navy officials were enraged, saying nobody bothered to tell them about the change of plans until the discussions to include $193.8 million for six new planes were finished.

"Talk about pork barrel," one Navy official said. "It's wrong, it's demoralizing."

In the trenches of the Pentagon budget wars, the tale of the P3 is an anomaly, a reversal of the usual procurement pattern in which a military service seldom turns down an offer for more of anything, much less argues against it when it does happen.

In this case, Navy officials say it is time to stop sinking money into the P3, the four-engine turboprop plane designed in the 1950s, and instead channel the funds into developing a new, more advanced replacement that can meet the increasingly sophisticated demands of submarine surveillance, the main task of the P3.

But the plans for a replacement plane have become mired in bureaucracy and political intrigue, with the Reagan administration arguing not that the Navy needs more P3s, but that the Defense Department should help out a defense contractor by keeping its assembly line in business.

And while the $193.8 million that has been requested to pay for more P3s is a relatively small amount in the multibillion-dollar world of Pentagon budgets, the P3 has become a textbook example of the internal turf battles and the labyrinthine ways in which military budget decisions are made.

The players in the P3 budget struggle include:The Navy, which argues that the old P3 model has been so loaded with new equipment and avionics that it cannot fly nearly as far or as long as once did, a major drawback that is leaving the Navy's patrol plane with less capability when Soviet submarine warfare abilities are increasing.

"She's a grand old airplane," said Rear Adm. Robert Leuschner, director of antisubmarine warfare for the Naval Air Systems Command. "Some of the older ones will begin to die of old age in the mid-90s . . . . What we're really looking for now is a more reliable, more maintainable, modern state-of-the-art airplane." The Defense Department, which has been dissatisfied with Navy proposals for a new-technology airplane and is reluctant to endorse a new project that could be more expensive than the P3 program. The department's actions also have served to protect Lockheed Corp. in any attempts to require competition between aircraft companies for the P3 replacement.

"The point is to keep the {P3 assembly} line open," according to Deputy Secretary of Defense William H. Taft IV. The Naval Reserve Association, with its large cadre of P3 aviators and close ties to the plane's producer. The group has lobbied vehemently on behalf of the patrol plane, which it says has proved reliable over the years. Congressional defense committee members who, after funding the P3 in the past, have given the Navy conflicting recommendations for finding a way to improve the antisubmarine warfare surveillance program.

Lockheed, which has produced 538 Orions for the Navy under an exclusive contract for 25 years.

Lockheed, one of the most politically active defense contractors, ranked third on a long list of defense giants in the amount of money it poured into the 1985-86 campaigns of congressional defense committee members, according to a new report by the watchdog group, Common Cause.

The company's contributions to members of the House Appropriations defense subcommittee and House Armed Services Committee totaled $151,953, the report said.

When the Defense Department decided last month that it should try to get more P3 money for another year, one of the first legislators it approached was Rep. Bill Chappell (D-Fla.), chairman of the Appropriations defense subcommittee.

Chappell received $15,000 in campaign contributions and $7,000 in honoraria from Lockheed political action committee from 1981-86, according to the Common Cause report. In both categories, he received the second highest amount of money of all the members of Congress who received Lockheed PAC funds. Telephone calls seeking comment from Chappell were not returned.

Several years ago, disgruntled Navy officials believed they could buy patrol planes cheaper if Lockheed were forced to compete with other companies for the chance to produce the aircraft. But the Navy discovered that no other companies were interested because it would cost too much to gear up a production line for an aircraft that had been produced by one company for so long.

That experience, as well as what they perceived as a need for a more modern submarine-hunter, convinced Navy officials that they should develop a new aircraft and open the competition to any company that wanted to bid. Thus, the concept of the Long-Range Air Antisubmarine Warfare Capability Aircraft (LRAACA) was born and, with it, the attempt to begin weaning the Navy from the P3.

But when the Navy submitted plans this year for the new aircraft, Defense Department officials said the proposals were too vague and ordered the Navy to do more research and come up with a more detailed program.

"They didn't have a good, clear program," Taft said in an interview. "It was not clear where it was going."

That is the official reason offered this year, according to Navy officials. They note that the Defense Department has overruled the Navy on its decision to discontinue the P3 production for the past four years also.

A strong lobbyist behind the Defense Department's position is the Naval Reserve Association, which has been a vocal advocate for maintaining P3 production. About one-third of the Navy's P3 antisubmarine warfare aviators are reservists, according to association president Capt. Pat Lucci.

Lucci argues that shutting down P3 production lines before a replacement aircraft is selected will disrupt crew training because it will inevitably lead to a temporary shortage of aircraft.

"If we do not have new aircraft coming on-stream, we will lose some crews," Lucci said. "They will be difficult to replace."

Some Navy officials say the reserve group has another motive. They say the reservists believe they would not receive the new patrol planes for years after they have been introduced to the active duty forces, relegating the reservists to a "second-class" status they have worked hard to overcome in recent years. Lucci denied that is a factor in his association's support of the P3.

Meanwhile, the Defense Department has taken up Lockheed's argument for keeping P3 production lines open: to allow Lockheed the chance to compete fairly with other companies for the new program.

"We have told the Navy if there's going to be such a competition, we plan to enter it," said a spokesman for Lockheed who asked not to be named.

"When an assembly line of any kind of aircraft shuts down and reopens, it gets to be a very expensive proposition."