The Senate gave Washington's home rule government a major victory yesterday by rejecting a proposal that would have eliminated city control over the location of foreign government chanceries here.

In the latest act of a years-long battle, the Senate struck down a proposed special federal commission that would have had powers to permit chanceries -- embassy office buildings -- in many Washington residential neighborhoods where they now are prohibited.

Mayor Marion Barry immediately hailed the action as a "significant vote" that "indicates the confidence the Senate has in the District government and its ability to handle its own affairs."

The vote came on an amendment to the Foreign Missions Act, a bill that places sharp new restrictions on foreign government use of property in the United States.

The amendment, approved in a 49-to-43 vote that crossed party lines, also deleted another controversial provision in the bill that apparently would have given the State Department direct power to permit consulates in U.S. cities, overriding local or state laws.

The Senate passed the amended bill by voice vote and the measure goes to a House-Senate conference committee today. The House earlier had passed a version of the legislation that included both the special commission and the expanded State Department power to locate chancery buildings, and conferees will have to resolve the differences between the two versions.

Sen. Charles McC. Mathias (R-Md.), who sponsored the amendment along with more than half a dozen other senators, attributed its passage to "concerns over home rule that spread far beyond the District's borders."

If the Mathias amendment survives today's conference, it will continue to leave the location of chanceries in Washington in the hands of three local planning agencies, all with federal members on them. The amendment calls on those agencies to give "substantial weight" to State Department recommendations in all future decisions.

Sen. Charles Percy (R-Ill.), chairman of the Senate Foreign Relations Committee and sponsor of the administration-backed bill, said Secretary of State Alexander Haig considered the proposed commission "a critical element of the legislation" because he believed chanceries presently are having difficulty finding suitable and secure offices in Washington.

Sen. Warren Rudman (R-N.H.) disputed this in yesterday's debate, saying "the track record doesn't substantiate the State Department's claim" because virtually every request by a foreign government for chancery space in recent years has been approved, except for one. Rudman said he believed that the rejected request, which came from Bangladesh, "was properly denied."

Percy said the main thrust of the bill, which virtually no senator spoke against, was to give the United States "leverage to retaliate" against nations which make life difficult for U.S. diplomats.

The Foreign Missions Act will create a new office in the State Department with powers to grant or deny any "benefits" connected with foreign government property in this country, including the power to grant or deny land purchases or sales by foreign governments. Currently, other countries can buy and sell property here at will and the only U.S. power is the extreme sanction of expelling diplomats, used primarily for offenses such as spying.

The battle over the new federal commission proposed in the act, with its almost unlimited powers to rezone Washington for chanceries, appeared to be a rematch of the 1979 fight between the State Department and Washington over chanceries here.

In that year, Congress backed the State Department and for the first time since home rule was granted in 1973, vetoed a City Council regulation.

Since that time Congress and the administration have sought a new way to handle the location of chancery buildings here, while the city has contended that current procedures are adequate. City officials lobbied strongly against the proposed new commission.

Mathias told the Senate yesterday "this is a home rule issue" that affects not just Washington but 213 other cities with foreign consulates, although Percy insisted the number of cities with full-fledged consulates was only about 60.

Percy insisted that in no case would the Foreign Missions Act permit preemption of any city or state laws, despite the apparent power to do so mentioned in the act. Mathias said Percy's personal reassurances were not sufficient. New York City, the U.S. Conference of Mayors and the National League of Cities have been very concerned about the act, Mathias said.

Percy argued yesterday that only in the District of Columbia would significant new powers be given the State Department and that these were necessary because local officials have been unresponsive to the federal need to accommodate embassies and their chanceries.

"We've forgotten what the whole purpose of Washington, D.C., is. We have to go back to square one," and enact legislation that gives the federal government more power in this matter, he argued unsuccessfully.

Sen. Thomas Eagleton (D-Mo.) estimated the commission would have cost the federal government $1 million, both to operate and to rezone the District of Columbia for chanceries, as required in the act. This is a job completed by the National Capital Planning Commission three years ago, after more than two years' work.