On Sunday morning, worshipers at the Sikh Foundation of Virginia in Fairfax Station were gathering for weekly prayers when a police cruiser pulled up in the parking lot. Paranjit Bedi, a foundation official, went outside to see if anything was amiss.

“Please let your congregation know we are here to protect you,” Bedi said a patrolman told him. Seeing bulletins about the attack unfolding at a Sikh temple in Wisconsin, police officials had immediately sent officers to inform local Sikh communities and assure them of support.

“This gave us a very good feeling,” Bedi, an engineer and longtime Burke resident, said Monday. “What happened was a terrible tragedy, but we feel very safe.”

As grim details continued to emerge Monday about a gunman’s rampage that left six worshipers dead at a Sikh temple near Milwaukee, Sikh leaders across the Washington area — as well as in other states — expressed sadness and horror. But they also had a surprisingly uniform sense of confidence that they were accepted by their own communities and well served by local law enforcement.

The Maryland and Virginia suburbs are home to several thousand Sikh families, mostly middle-class professionals of Indian descent. In the past 25 years, they have built more than 20 temples, known as gurdwaras, some with elaborate, highly visible features such as gold domes.

Many can recount insults or rude comments directed their way over the years, especially after the terror attacks of Sept. 11, 2001. Some people who were angry and frightened took out their hostility on anyone with a beard or wearing a turban. Both are required signs of devotion among adult men of the Sikh faith, which is based on the values of pacifism, charity and self-discipline.

“I was working at Dulles Airport right after 9/11, and someone shouted at me, ‘Taliban, go back to Afghanistan,’ ” said Pritpal Singh, 38, who runs a convenience store in Virginia.

“Hate hurts,” he said. “Most Americans know that we are from a peaceful faith, but some people are still ignorant. They confuse us with Muslims or terrorists.”

The New York-based Sikh Coalition, an advocacy group, has reported more than 700 cases of attacks or discrimination against Sikhs in the United States since the Sept. 11 attacks, ranging from workplace harassment to street beatings and the torching of gurdwaras. Between 2001 and 2011, at least six Sikhs were fatally shot in what appeared to be hate crimes, the group found.

Yet Sikhs in the Washington area said harassment and hostility have diminished greatly in the past several years, as they have become a more familiar and respected presence. Many are U.S. citizens and active in civic groups or at their children’s schools, and many gurdwara leaders have worked closely with church and mosque leaders through interfaith groups.

“We have been trying hard to let people reach out and know who we are, that we are peaceful, patriotic and hard-working,” said Surjeet Sidhu, a bank administrator for the federal government and a board member at the Fairfax Station temple. “It has been a challenge, but we have never felt not welcome.

“If anything, I hope this tragedy makes us reach out even more.”

Officials of the All Dulles Area Muslim Society, which has spearheaded a regional interfaith network, expressed outrage Monday at the attack in Wisconsin and called on all Americans to be “extra vigilant in our common struggle against behavior that threatens the very core of our nation’s principles.”

Across the country, Sikh communities have received outpourings of support in the wake of the shootings, officials of national Sikh advocacy groups said. Sarpreet Kaur, executive director of the Sikh Coalition, said she attended a crowded prayer vigil Sunday night in New Jersey where “the doors were open, the public came, and the chief of police was there, too.”

At least several hundred thousand Sikhs of South Asian origin live in the United States. In addition, thousands of people born in the United States have joined the faith.

Navdeep Singh, an official of the Sikh American Legal Defense and Education Fund in Washington, said his group had been deluged with calls and messages from well-wishers since Sunday. People also have expressed support by calling radio shows, attending vigils and offering help from churches and mosques.

“Americans from all walks of life are embracing us,” Singh said.

In Oak Creek, Wis., members of the temple where the attack occurred were reeling in shock and grief the day after their preparations for prayers and a mass free lunch were disrupted Sunday by gunfire and screams of terror. Several Sikh men visiting the area recounted being taunted as “Osama” after the Sept. 11 attacks or having their temples vandalized. Other members said they were still worried about being mistaken for Muslim extremists.

But Oak Creek temple leaders said they had encountered no problems in the five years since their house of worship opened in the Milwaukee suburb.

Rakesh Kumar, a Hindu who prays there, said area residents from various faiths often attended the gurdwara’s picnics.

“It’s my neighborhood as well as my community,” he said. “People are so loving. I love Oak Creek.”

In both Loudoun and Montgomery counties, Sikh leaders said they had little fear of attack and had developed close relationships with local police.

Gurusangat Singh, a retired businessman who is an official at the Raj Khalsa Gurdwara in Sterling, said that “many of us who wear turbans have received a steady flow of insults since 9/11, but it’s mostly in rural areas. Around here in the metropolitan area, people are more broad-minded. We don’t have a sense of threat.”

As in Fairfax, the proactive role of law enforcement officials in Loudoun County has been a major factor in putting the Sikh community at ease. Sheriff Mike Chapman and his deputies have visited temple services in both Sterling and Ashburn, covering their hair with orange kerchiefs for the occasion.

“It is very important that we understand the culture of all our residents, and that they understand our mission in law enforcement,” Chapman said Monday. On Sunday, he said, he ordered extra patrols sent to Sikh communities, as well as to several mosques.

“We know this was an isolated incident, but we want to have an extra presence for the next few days,” he said. “We just want to be sure.”

Michael Laris in Oak Creek contributed to this report.