In Virginia, bar and restaurant owners can lose their liquor licenses if they hire known homosexuals or permit their establishments to become gathering places for them.

Police in the state, where under the law homosexual sex is considered a "crime against nature," are regularly on the lookout for homosexual "cruising" or encounters. And Northern Virginia law enforcement officials recently stepped up undercover surveillance at several public places, including a shopping mall's bathrooms, to catch offenders in, or soliciting for, the act.

But just across the river, the situation for gays is considerably different.

Sodomy is still a crime in the District of Columbia, but the law against it is not enforced and D.C. police long ago abandoned undercover stakeouts at public restrooms. Gay bars in town are well known and plentiful, and a gay representative sits on the city's alcoholic beverage control board.

For Washington area homosexuals, such contrasts in treatment are common. They say they have known for a long time that how they live, work and socialize is as much a matter of geography and political clout as of law.

"The climate for gays in D.C. is completely different than in Northern Virginia and to some extent Maryland," says Steve Smith, president of the Gay Activist Alliance of Washington. "What we have here now is exceptional."

Contrasts in political influence are especially sharp.

When gays in the city held their 15th annual Gay and Lesbian Pride Day last June, for example, D.C. politicians from Mayor Marion Barry on down made sure their presence or support was noted.

Yet when the Virginia Gay Alliance, a homosexual group, tried to survey members of the Virginia General Assembly about their stands on gay rights, only 10 percent of the legislators -- normally careful to attend to constituent inquiries -- bothered to reply.

Smith says District gays have more influence with the city government than their counterparts in San Francisco, long considered a mecca for gays because of its huge and visible homosexual population. He and others attribute this influence to the District's totally urban, generally liberal character and to its predominantly black population, which is sensitive to minority rights.

Gays in the city, who have formed several political groups, also had the good fortune and foresight to back a winner when it mattered. In 1978, they were early supporters of Marion Barry in his uphill, three-way mayoral primary. The mayor-to-be was grateful and stayed grateful, appointing gays to numerous boards and commissions and consulting them on key policy decisions.

In Maryland, gays don't have the same political constituency or access to decision-makers but they have won support among many area officials. The human relations commissions in both Prince George's County, where a gay sits on the commission, and Montgomery County are strong advocates of gay rights, and there are seldom complaints of police harassment.

"The real difference is D.C. compared to everyone else," says Susan Silber, an attorney for the Suburban Maryland Lesbian/Gay Alliance. "D.C. is best, then Maryland and then Virginia."

In Virginia, where rural and conservative Southerners fought integration and where the legislature consistently turned down the Equal Rights Amendment, gays measure their progress more slowly.

"Nice people don't talk about sex in Virginia, and they certainly don't talk about gay sex," says Tom DePriest, a government attorney who is the founder and former president of the Virginia Gay Alliance.

Unlike the District's gay political groups, some of which were formed more than a decade ago, the Virginia group is a little more than three years old and still trying to attract a bolder membership.

"Gays in Virginia have bought the plantation mentality that says don't rock the boat," says DePriest. But, tempering his criticism, he notes that being openly gay -- "coming out of the closet" -- can carry risks.

"People have been fired from their jobs -- nobody wants to be first to put their neck on the block," he says.

Thus, when the Virginia General Assembly was considering two gay rights bills last session -- one to legalize sex acts between consenting adults in private and another to strike down state alcoholic beverage control board sanctions against employing homosexuals or letting them congregate in bars and restaurants -- DePriest says only a dozen people called or wrote letters on behalf of the legislation, which never got out of committee.

But given Virginia's conservative attitudes, DePriest is comforted that gay views were heard at all.

"We lost overwhelmingly," he says of a 14-4 vote against the consentual sex measure. "But we got to speak on the bill, and they listened. They were polite."

Del. Bernard S. Cohen (D-Alexandria), who has twice sponsored sexual privacy bills, says there has been no political fallout because of his support for gay rights.

"I got some letters that I file under 'Kooks and Other Paranoids', but my mail was overwhelmingly in favor," says Cohen, who thinks sexual privacy legislation would be "a tough subject" any place.

Although 27 states, including Iowa, West Virginia and Texas, have repealed restrictions against it, sodomy is still illegal in Virginia, Maryland and the District.

But only Virginia jurisdictions, Virginia State Police and the U.S. Park Police -- who conduct surveillances along the George Washington Parkway and near the Iwo Jima Memorial -- have been on the lookout in any organized fashion for real or potential homosexual encounters.

The District stopped staking out homosexual "cruising" spots 10 years ago, and suburban Maryland police haven't engaged in any "crackdowns," according to gay groups that monitor such activity.

"We don't tolerate sex in public places any more than anyone else, whether by homosexuals or heterosexuals," says D.C. police inspector Gary Abrecht, a night supervisor who is also the police department's liaison to the city's gay community. "But we haven't had that many complaints" about the problem.

Most gay organizations take a similar view, and some have adopted resolutions stating as much. Their outcry over recent arrests at Springfield Mall and other Northern Virginia sites has more to do with a dispute over police tactics and a suspicion that gay sex has been specifically targeted.

Gays draw an analogy between their cruising activities and what goes on in the "straight" singles' bars in Georgetown and elsewhere in the city. And, they argue, the gays arrested have been charged with solicitation, not with any public sex acts.

Fairfax County police, who have conducted four undercover campaigns this year against well-known cruising spots, say they stepped up their activities because of citizen complaints. They say the suspects are charged with solicitation because police officers stopped short of actual participation.

Police and a Mall spokeswoman say the problem appears to be under control now. Yet a security official at one of the stores where police staked out the bathroom is surprised that there was ever any fuss.

"There was no problem as far as I'm concerned," says Frank Michela, of Penny's, who says police didn't consult the store before setting up the stakeout. "To my knowledge, we never received a complaint from any customer."

Capt. Michael Young, Fairfax County's acting commander for the criminal investigations bureau, says officials are interested in policing sex that is committed in the "public arena . . . we have not sought to prevent a private way of life."

But Jim Lowe, an Alexandria attorney who has represented many of the men arrested in the Mall and other stakeouts, says what the Fairfax police are doing amounts to "gay baiting . . . you don't find police officers charging heterosexual couples in lover's lane."

The police, Lowe says, "are actively involved in the solicitation and in getting someone to say the magic words. It's outrageous."

Lowe says many of the cases get thrown out in court or reduced to a charge of disorderly conduct. And almost all of the cases he has handled, he says, have involved no public sex acts but rather the luring of gays to cars in the parking lot, where a conversation leading to a suggestive remark or a sexual invitation occurs.

The Virginia arrests have brought mixed reactions from area gays, particularly since they regard those caught in the police stakeouts as outside the openly gay community.

"Some people who are out are in a hurry to forget what it's like not to be out," says Smith. He notes that news about the police stakeouts was reported in the Washington Blade and other gay publications but that the people who frequent such places don't read the gay press.

"People in the closet, who are married or in the military, are not going to do anything that might expose them," he said. "But in their desperate actions, they end up doing something far riskier."

Smith and many gays were angry when The Washington Post printed the names of all those arrested following one police sweep at the Mall. Yet "seeing that they were Army officers, ministers, principals proved that gay people are everywhere and showed how many of us there are."

Gays in the surburbs frequently speak of Virginia and Maryland as their "bedroom," where they conduct their sex lives in private, and of the city as the place where they can have a social life.

But they still worry about police attitudes in their jurisdictions and envy what District gays have been able to accomplish.

Abrecht, who has been the D.C. Police department's liaison to the gay community since 1978, says gays initially pushed the police for more crime protection, particularly in the isolated warehouse district where many gay bars are located. There also was concern about what gays call "queer bashing" and attacks by hustlers.

Today, human rights training at the police academy includes a segment presented by the gay community. Abrecht says prospective officers hear gay complaints against the department, discuss misconceptions and stereotypes about gays and get a better understanding of closeted gays and why they might be reluctant to make police reports.

Suburban gays say they have a good working relationship with human rights commissions. Some Montgomery County Council members also turned up for a "victory dinner" in September when the Maryland Court of Appeals struck down a referendum challenge to a gay rights measure that the council had added to the county's Human Rights Code.

"On majority, there is a great deal of liberal feeling toward gay people in Montgomery County," says Don Crisostomo, treasurer and cofounder of the Suburban Maryland Lesbian/Gay Alliance, whose group hopes to start a police awareness program in the county similar to D.C.'s.

Virginia gays are optimistic that they will eventually make the same kind of progress, but DePriest says it will mean "educating every public figure and the electorate."

The Gay Alliance has chapters in five of the state's 10 congressional districts and helped persuade Richmond's human rights commission to study discrimination against gays. DePriest says meetings with Arlington County officials have helped improve police relations there, and he praises Dels. Cohen and William P. Robinson Jr. (D-Norfolk) for their sponsorship of gay rights legislation.

Fairfax police and DePriest recently cooperated in a Crime Solvers case involving the murder of a gay man. Police, using lists supplied by the Virginia Gay Alliance, mailed out a description of the suspect to 500 gay-oriented publications, which led to an arrest in Philadelphia.

Capt. Young says Fairfax County police work just as hard on crimes involving gay victims and he sees no need for a special police liaison with gays or gay input into police academy training. "I don't think we treat them differently," Young said.

"That's the way white Southerners were talking 25 years ago about blacks," DePriest retorts. Despite the Crime Solvers cooperation, he complains that the Alliance has been trying for several months to meet with county police about other gay-related issues and "they've refused."

So in Northern Virginia, as far as gays are concerned, the tensions and controversy continue -- with predictable results.

Jeff Levi, Washington representative for the National Gay Task Force, says he recently got a call from a man arrested for solicitation at George Mason University.

"He said he goes to the school library to read the Blade and that an undercover cop saw this and followed him to the parking lot," where a conversation and subsequent arrest occurred. The man intends to challenge the police action in court. And he's doing something else, too.

"He called to tell me he's moving into the District," Levi said.