Shivering in the cold outside a Manassas polling place Tuesday, the candidate held out his hand and greeted every arriving voter with the same polite smile and message. “Hello, I’m Richard Cabellos, and I’m running for the House of Delegates.”

A few people said hello back, but others hurried past or ignored his hand.

“It’s okay. I’m used to rejection,” said Cabellos, describing how one man whose door he had knocked on crumpled his campaign brochure and yelled something about illegal immigrants running for office.

A few minutes later, a young Hispanic woman hesitantly approached the polling entrance at a high school. Cabellos greeted her in Spanish. “You came to our house and talked to my mom,” she said excitedly.

Cabellos nodded as he watched her go inside. “That’s one vote,” he said.

By day’s end, the Peruvian-born Democratic candidate had received 7,766 votes after weeks of canvassing neighborhoods and mailing literature to voters across his district in Prince William County. At 44.9 percent of the vote, it was far from enough to defeat the Republican incumbent, Jackson H. Miller, but Cabellos seemed unfazed.

“You have to understand, my dad grew potatoes in the highlands of Peru, and here I am running for political office in America,” he said in an interview later, starting to weep and apologizing for the display of emotion. “It shows that you can do anything in America. That’s why I’m running, to open doors and show other people that they can, too.”

Cabellos, 32, a community center director who immigrated to the United States at 15, was one of three foreign-born candidates who made it onto the ballot as Democratic nominees for the Virginia House this fall.

The two others were Atif Qarni, 35, a Pakistan-born middle school math teacher and ex-Marine from Manassas, and Hung Nguyen, 42, a Vietnamese refu­gee and high-tech business owner from Chantilly.

None of the three had ever run for office before, and none of them won Tuesday, although Qarni came within 500 votes of defeating Republican incumbent Robert G. Marshall (Prince William).

All three described their candidacies as opening salvos in a long-term battle to gain political acceptance for immigrants in a region that is diversifying rapidly but sometimes contentiously, and to motivate more of them to join the electoral fray.

Cabellos’s 50th District and Qarni’s 13th District encompass different parts of Prince William, where the foreign-born populace is 21.3 percent of the total and the combined Hispanic and Asian population is 29 percent. Hung’s 67th District comprises parts of Fairfax County, where the foreign-born populace is 23.4 percent and the Hispanic and Asian population is the highest in the state, at 34.5 percent.

“I am here to blaze a trail,” said Hung, who lost to Republican James M. Le-
Munyon (Fairfax) by 10 percentage points. “I am the first Vietnamese to ever be on the ballot in Virginia. I’m the new guy, I’m keeping my message upbeat, and I’m letting people know I’m here.”

Qarni, a Muslim, came within three percentage points of defeating Marshall, who won four years ago by a wide margin and is known as an outspoken conservative on issues including abortion, gun control and gay rights.

Qarni said he received support from both fellow immigrants and moderate longtime residents who were tired of what he called “polarizing politics.” He said some supporters had advised him to shave off his short beard for a campaign Web site photo, but that he dismissed the idea out of hand.

“I hope to become the first Muslim American in the House of Delegates, but I am running as a teacher and a Marine,” Qarni said while waiting to greet voters at the polls, accompanied by his father and 5-year-old son. “I believe in common-sense issues, not divisive politics. ”

During their campaigns, the three candidates tailored their outreach to various audiences. In mainstream settings and mass mailings, they stressed widely shared public concerns about traffic congestion and large class sizes in schools. In ethnic enclaves and foreign-language media interviews, they highlighted their personal backgrounds and concerns for immigrant issues.

Their messages to fellow immigrants were delivered in muted, measured tones. For one thing, all three of their districts are attracting new Americans as they move up the economic ladder, and some longer-established groups such as the Vietnamese include many Republicans. Moreover, all three areas have been scorched by ugly fights over immigrant-linked problems that these new politicians said they hope to help heal.

Cabellos is a veteran of two such battles in recent years: one in Herndon, where a proposed center for day laborers aroused strong opposition, and the other in Manassas, where an influx of poor Hispanics led to a high-profile political crackdown against illegal immigrants. He said those experiences motivated him to seek office, and his campaign drew enthusiastic volunteers among young Latinos and Democrats in the area.

Yet he is also the product of a decade of guidance from experienced Democratic leaders, especially former governor Mark R. Warner and Arlington County Board Chairman J. Walter Tejada, who he said taught him to win people over with polite persistence and humility.

On Tuesday afternoon, as he stood outside another Manassas school, wearing a plain black windbreaker and khakis, Cabellos spotted a well-dressed Hispanic woman, and they started chatting in Spanish.

After she voted and came out again, she went up to him and said, again in Spanish: “I voted for you. Now I will hold you accountable.”

A little while later, a wiry, gray-haired man strode up to the school, grabbing a Republican sample ballot. Cabellos came over and introduced himself.

“Is it true what I read about your criminal convictions?” the man demanded with a scowl. Cabellos did not bat an eye. “Yes sir, I was convicted of drunk driving 13 years ago,” he said. “I made a mistake, and I paid my debt, and I have lived a positive life since then. I hope you will vote for me.”

Five minutes later, the man strode back outside. As he passed Cabellos, he nodded and said, “Good luck to you.”

Correction: An earlier version of this story incorrectly reported that Richard Cabellos was the first Hispanic in Prince William County to run for statewide office in Virginia. This version has been corrected.