The District government would be able to count ballots from last year's referendum on legalizing marijuana for certain medical purposes and to spend city money on a needle exchange program under a plan endorsed yesterday by the House Appropriations Committee.

The two victories for home rule advocates came just before the House panel approved the District's proposed $4.7 billion spending plan for fiscal 2000, including the $300 million, five-year package of tax cuts agreed to by city officials.

"We got two important pro-democracy votes here," said Del. Eleanor Holmes Norton (D-D.C.), who has long expressed frustration with Capitol Hill Republicans who in recent years have overridden the wishes of city officials.

Yesterday's debate focused on "riders," amendments that various members of Congress had attached to the D.C. bill to prohibit the city from spending money on controversial programs -- and to use the District's budget process to make political statements.

Members of the House panel made clear yesterday that they were not advocating the legalization of marijuana in the District, but several Republicans broke with their party leaders and agreed with Democrats that Congress should no longer prohibit the city from even counting the ballots from the 1998 referendum.

More than 110 communities in 30 states use needle exchange programs to try to slow the spread of HIV among addicts, but the District -- which has the nation's highest rate of new HIV infections -- suspended funding for a two-year-old program last year after Republicans in Congress inserted language in the city budget prohibiting any spending on such an effort. The GOP lawmakers said they feared that needle exchange programs encourage drug use.

Democrats who have fought to remove the medical-marijuana and needle-exchange riders from the D.C. budget said they still could lose this year when the budget goes to the full House for final approval.

But yesterday's votes gave hope to home rule advocates and those who consider needle exchange programs a key to curbing the spread of HIV.

"This is great news for AIDS prevention," said D.C. Council member Jim Graham (D-Ward 1), a former director of the Whitman-Walker Clinic, an AIDS prevention and treatment organization. "If this holds, we can repair the crippling damage that was done last year."

The Senate already has passed a version of the D.C. budget that does not include bans on needle exchanges and the counting of ballots from the marijuana referendum.

The referendum calls for the city to legalize the possession, use and cultivation of marijuana if recommended by a physician for a serious illness. If D.C. voters approved the referendum, Congress would have the power to reject the new law.

The budget approved by the House committee includes about $95 million in new initiatives, the largest piece of which would be used to expand drug treatment and testing for the 30,000 people on parole, on probation or awaiting trial. An additional $17 million would go for tuition support for D.C. youths to attend out-of-state colleges, allowing them to pay in-state tuition rates.

Rep. Ernest J. Istook Jr. (R-Okla.) argued that it would make no sense for Congress to give the District extra money to fight drug abuse while allowing it to spend local funds to distribute clean needles to addicts.

But Reps. James P. Moran Jr. (D-Va.), Julian C. Dixon (D-Calif.), Nancy Pelosi (D-Calif.) and others argued that although Congress has the right to prohibit the use of federal funds for the needle exchange, it should not prevent the city from using its dollars on such an effort.

They cited D.C. statistics indicating that AIDS is the leading cause of death for city residents ages 30 to 44, an AIDS death rate seven times the national average.

Six Republicans ultimately agreed with the Democrats, and the panel voted 32 to 23 to prohibit only the use of federal funds for a D.C. needle exchange program.

"This is not about drug use," said Rep. Jim Kolbe (R-Ariz.). "It is a matter of preventing the transmission of an illness and disease through dirty needles."

The debate over the medical marijuana referendum followed similar lines. Democrats and a few Republicans argued that the city should be able to count a vote taken by its residents, regardless of the subject.

"What we are talking about here," said Rep. Randy "Duke" Cunningham (R-Calif.), "is the constitutional right to speak out and express an opinion."

Meanwhile, Moran tried unsuccessfully to strike language from the budget that prohibits the city from spending local money on abortions, on health care for domestic partners and for lawyers to pursue a court case seeking expanded voting rights for D.C. residents.