The Interior Department has agreed to put most of California's coastal waters off-limits to oil drilling until the year 2000, in return for the lifting of a congressional moratorium that has blocked oil-lease sales off much of the state for four years.

According to the terms of a tentative agreement announced yesterday, drilling will be permitted on 864,000 acres off California, about 2.3 percent of the 37 million acres now closed to drilling under the moratorium.

Shortly after the agreement was announced, the House Appropriations Committee voted not to extend the drilling ban when it expires Sept. 30.

The agreement, reached after nearly a month of intensive negotiations between a group of California congressmen and Interior Secretary Donald Hodel, still needs to be refined and accepted by state and local officials in California. But a spokesman for Rep. Leon E. Panetta (D-Calif.), a principal negotiator, said its sponsors were optimistic that it would win approval and be incorporated into legislation this year.

"It's hard to say what will happen," he said. "But it's a good, reasonable compromise."

Environmentalists generally hailed the agreement, which signals the end of a bitter stalemate between the Reagan administration and the president's home state. Congress approved the first moratorium in 1981 at the urging of Californians alarmed by the administration's aggressive offshore leasing policies. It has been renewed each year since.

Hodel campaigned vigorously against continuing the moratorium, saying he was willing to settle his department's differences with California through consultation. But according to environmental lobbyists, negotiations did not begin in earnest until a House Appropriations subcommittee voted last month to impose the moratorium again.

"We've never liked moratoria battles in Congress, but we thought they were necessary and you could say they worked," said Andrew Palmer of the Environmental Policy Institute. "We think this is really the framework for a long-term solution. The delegation pulled California out of the fire with this agreement."

The oil industry, meanwhile, criticized the move as "not in the interests of the American public."

"It certainly is not in the interests of Californians, who consume one-tenth of all the gasoline used in the United States and who must remember the long service-station lines of the 1970s -- a circumstance some of their congressional representatives apparently do not recall," the American Petroleum Institute said in a statement.

Most of the tracts that would be open to leasing under the agreement are in the Eel River Basin off northern California, an area that Interior geologists say has a high probability of producing natural gas. Oil companies would be permitted to sink one exploratory well in each of three other areas -- Point Arena, Bodega and Santa Cruz.

In all, the agreement would open 150 tracts for leasing, compared with 6,460 tracts the administration initially envisioned.

According to conservation groups, some of the most promising tracts are in areas considered environmentally sensitive. Lisa Speer of the Natural Resources Defense Council said the agreement might involve "significant costs" to northern California wetlands and estuaries, but she called it "an important step toward achieving a balanced policy of offshore oil and gas leasing."