PORTLAND, Maine (AP) _ Maine's authority to fine the Navy up to $25,000 a day for violating state hazardous waste regulations at a nuclear submarine overhaul base has been upheld by a federal judge.

Maine and several other states that have been trying to force the federal government to abide by their hazardous waste laws had awaited U.S. District Judge Gene Carter's decision for a year.

Maine Attorney General James E. Tierney, who filed the state's lawsuit seeking a cleanup and fines against the Portsmouth Naval Shipyard in Kittery, could not be reached by telephone on Thursday.

But Deputy Attorney General Philip Ahrens said he hopes Carter's decision Wednesday sets a pattern for rulings in similar cases in other parts of the country.

''We believe that the federal government, which has some of the worst hazardous waste sites, should be subject to the same laws as everyone else is,'' said Ahrens.

It was not immediately known whether the Navy would appeal Carter's decision to the 1st U.S. Circuit Court of Appeals in Boston. Justice Department attorney Mary Elizabeth Ward, who handled the case for the Navy, could not be reached through the Kittery facility, where phones were answered by a taped message.

Tierney filed two lawsuits in 1986 asking that the southern Maine shipyard be required to clean up inactive solid-waste and hazardous-waste dumps, including a landfill and mercury disposal areas.

''The shipyard needs outside pressure,'' Tierney said at the time, adding that the Environmental Protection Agency did not have enough influence ''to push the Pentagon around.''

The Navy claimed that it could not be forced to pay civil penalties even if it violated Maine laws, and that Maine's annual fees levied against all hazardous waste generators were an unconstitutional tax on the federal government.

In November 1987, then-U.S. Magistrate D. Brock Hornby recommended that federal facilities not be exempted from state environmental regulations. Several states joined Maine in asking Carter to uphold Hornby's findings.

On Wednesday, Carter declared he ''wholeheartedly concurs'' with Hornby's conclusion that the federal Resource Conservation and Recovery Act allows the recovery of civil penalties by a state agency against the federal government.

Quoting from Hornby's conclusion, Carter said that federal facilities ''will be treated the same as private institutions so far as enforcement of the solid waste and hazardous waste laws are concerned.''

Carter also ruled that the state can require the shipyard to contribute to a state fund used to administer the state's hazardous-waste program.

''The fees apply to other hazardous water licensees and generators, and it is clear that the intent of (the federal law) is to have federal facilities treated in the same manner 'as any person,''' Carter said.

On the issue of civil penalties, Carter agreed with Hornby that Congress waived sovereign immunity, a legal doctrine that shields the government from most lawsuits, when it passed the RCRA in 1976. RCRA subjects federal facilities to state hazardous waste laws.