he federal government agreed yesterday that two Indian tribes have legitimate claims to as much as 10.5 million acres of land in Maine and said it will support those claims in court.

Much of the land has been settled by non-Indians for years and is valued in the billions of dollars. The Indian claims, bitterly contested by residents and the Maine government, already have produced a fiscal crisis in the state's municipalities.

Support for the Indians' claims came in a report prepared by the Interior Department, spelling out what should be done to honor a court order holding that the government has an obligation to protect legitimate tribal claims.

An Interior official said the report supports claims of the Passamaquoddy and Penobscot tribes for between 8 million and 10.5 million acres. The Indians had sought up to 12.5 million.

At the same time, the Interior and Justice departments suggested that Congress should ultimately settle the entire dispute with legislation and said the Carter administration should have a chance to express its views.

Maine Gov. James B. Longley, who had argued against federal intervention, had no comment yesterday. But an aide said he had been advised of the new position Wednesday and promptly sent a wire to the tribes attorney. Tom Tureen, urging cooperation for a settlement that would not disturb the homes or the jobs of Maine citizens living in the disputed areas.

The governor asked Tureen to make a public pledge that the Indians would accept a money settlement and wold discountinue their claims to the large land area.

The land claims Longley hopes to see dropped have already precipitated a financial crisis for Maine's cities claims undermine property titles were and towns. Investors' fears that the a factor in the cancellation last September of a $27 million bond sale by the Maine Municipal Bond Bank.

The Indians have been suing Maine since 1972 for land they say was illegally taken from them in violation of the Indian Non-Intercourse Act of 1790. That law stipulated that no state could acquire Indians' aboriginal territories without action by Congress.

The federal government initially was reluctant to press the Indians' claims, but was ordered to do so by court decisions that said its trust relationship with the tribes requires it to protect their descendants and their valid claims.

Interior, observing that it was under court order to recognize the tribes, said that ". . . we are in no position to view our responsibilities thereunder in a niggardly fashion.

"Indeed, for the government to file suit for less than what the Tribe can demonstrate is a legitimate claim could be seen as having the practical effect of extinguishing Indian title."

The Department of Justice, in seeking a delay until March 1 for a reply to the court, suggested that Congress begin work on legislation to clear up the dispute. It also said that the incoming administration of President-elect Jimmy Carter has expressed an interest in reviewing the matter.