There were plenty of open seats on the San Diego trolley, but Adrian Richard Vergara chose the one right next to a teenage Syrian refugee.

The teen boy felt nervous as Vergara sat down, he would later say. Traveling on his way home from school, he was talking on FaceTime with a friend, speaking in Arabic — when suddenly the man next to him ripped the earbud out of the boy’s ear.

“What trash are you speaking?” Vergara asked him, as prosecutors described at his arraignment last month.

And when the teen refugee responded, “Arabic,” prosecutors said, that’s when the brutal beating began

On Monday, Vergara, 26, pleaded guilty to the Oct. 15 felony hate-crime assault after surveillance video on the trolley identified him as the attacker. Vergara is expected to be sentenced next month to five years in prison, KGTV reported.

In a statement to KSWB last month, the 17-year-old refugee said he hoped to dispel mistaken beliefs among people who have never met Arabs or Muslims that they are dangerous, and encouraged other members of the community to go to the police if they are ever attacked like he was.

“To all the people who are attacking our community: Don’t judge us without knowing us,” he wrote.

The spontaneous attack shook San Diego’s refugee community, especially on the heels of another San Diego man’s unprovoked attack on three Muslim women wearing hijabs. In that Oct. 6 case, also charged as a hate crime, 50-year-old Kyle Allen allegedly shoved one of the women, slapped another and then tried to pull off the third woman’s hijab. Allen has pleaded not guilty.

The 17-year-old refugee on the trolley had been reading up on that case ― just days before his own attack, he told KSWB in a statement. (The teen, who has not been identified by authorities, has spoken to local news outlets anonymously, fearing for his and his family’s safety.)

He and his family had come to the United States in 2016 after fleeing the war-torn city of Homs, Syria, in 2012, he and his mother told the San Diego Union-Tribune. They had spent a year in Algeria and three in Jordan before arriving in California, not knowing a single person.

But from the start, they were used to feeling unwanted in their new community, they said. Not long after arriving in the United States, his older brother was attacked because of his identity, and his mother also told the Union-Tribune that she had been cursed at while wearing her hijab. They chose not to report the first attack, he said, “because we didn’t think justice was possible.”

“We came to this country under the belief that we would have civil rights and liberties and safety,” he wrote in a statement to KSWB. “When the attack happened to my brother we realized this wasn’t true for everyone.”

Now, after his own attack, he felt he could not stay silent, he said.

Surveillance video of the attack confirmed the teenager’s account of what happened, San Diego police said. On the trolley, Vergara repeatedly yelled, “F--- Arabs!” as he beat the teenager, punching him in the face five or six times, prosecutors said.

The refugee told the Union-Tribune that he was hurt, too, by the fact that none of the people on the trolley intervened as they stood by and watched the attack.

“It wasn’t just what happened that made me mad and made me sad. It was the silence of others,” he told the newspaper with help from an interpreter.” Why didn’t they help me? Why they did nothing while I was being beaten?

When he went home, his mother told the newspaper, he went straight to his room, hiding his face until revealing what happened later that day.

The Partnership for the Advancement of New Americans, a San Diego-based organization assisting refugees, assisted the teen in filing a police report.

Vergara was apprehended Oct. 22 for an unrelated misdemeanor narcotics charge when the Port of San Diego Harbor Police recognized him as the man wanted in the trolley hate crime, KGTV reported.

The family was encouraged by the arrest and ensuing hate-crime investigation — but exasperated by the continued attacks on Muslims and refugees in their community, his mother said.

“Enough. I am tired of what is happening,” his mother told the Union-Tribune. “All we’re looking for is a safe environment where me and my kids can live with dignity and respect. … Wherever you go, stand with your values and your morals. This is the message my husband and I share with our kids. Wherever we go, we try to treat people with dignity and respect.

“That’s what we want. We simply want to live.”