NEW BEDFORD — Dias Kadyrbayev and Azamat Tazhayakov were college roommates who clicked with Dzhokhar Tsarnaev, another soccer-loving immigrant from the former Soviet Union who, unlike them, blended seamlessly into the United States. Tsarnaev spoke perfect English and knew where to shop and how to have a good time.
“He knew the system,” said Robert G. Stahl, Kadyrbayev’s criminal lawyer. “He knew how to go purchase things, where to go in college, what to do. . . . So they gravitated toward each other.”
The nature of that friendship came under sharp scrutiny Wednesday in Boston, where the men faced charges in two federal courtrooms, first in immigration court, where they had an initial hearing on possible deportation to their native Kazakhstan in Central Asia. Then in the afternoon, federal officials charged the roommates and a third man, a US citizen from Cambridge, with helping cover up their friend’s alleged role in the Boston Marathon bombings.
Dzhokhar Tsarnaev is accused of detonating two bombs at the Marathon with his brother Tamerlan, 26, who died in Watertown after a gunfight with police. The bombings killed three people and injured more than 260. The brothers are also suspected of killing MIT police officer Sean Collier.
In immigration court Wednesday morning, lawyers for Kadyrbayev and Tazhayakov sought to portray the 19-year-olds as mere acquaintances of Dzhokhar Tsarnaev, who speaks fluent Russian and is also 19 and in the same sophomore class at UMass Dartmouth.
Lawyers said the Kazakh men were engineering majors whose extremely low grades were endangering their student visas. Kadyrbayev was expelled after the fall semester because of low grades, a university official said.
One of Tazhayakov’s lawyers said in immigration court Wednesday that Tazhayakov was reinstated after switching his major to economics.
“It’s a simple student violation” of their visas, said Linda Cristello, a Boston immigration lawyer, after the initial hearings in immigration court.
In Kazakhstan, Kadyrbayev’s father Murat recently told the online Kazakh news site Tengrinews.kz that his son got excellent grades in high school and “knew Tsarnaev” in college and hung out with him sometimes.
But federal officials offered a different portrait of Kadyrbayev and Tazhayakov — and a third friend, Robel Phillipos of Cambridge, in the criminal allegations against them Wednesday in US District Court.
Federal agents alleged that Tsarnaev and the Kazakh men were good friends who met in fall 2011 and grew closer last year, when Kadyrbayev apparently posted a photograph of the three in New York’s Times Square on his VKontakte social media page.
Friends and court records said the friends went to parties and shared dinners and rides to class. Kadyrbayev visited Tsarnaev’s home in Cambridge and met his family members, according to court records.
Two months before the bombings, Tsarnaev, Tazhayakov, and others gathered on the banks of the Charles River and ignited fireworks. One month before the bombing, court records show, Tsarnaev confided in the men over dinner that he knew how to make a bomb.
It is unclear how Robel Phillipos met the two Kazakh men. Phillipos and Tsarnaev were in the class of 2011 at Cambridge Rindge and Latin School.
All four men enrolled in UMass Dartmouth in 2011, though school officials said Phillipos withdrew last year.
Zolan V. Kanno-Youngs, who works part-time at the Globe and knew the boys from high school, described Phillipos as “an extremely popular kid, just like Dzhokhar.”
Although Phillipos and Tsarnaev were close, Kanno-Youngs said, Phillipos led a more disciplined life during his teens, avoiding the parties that Tsarnaev favored. Instead, Phillipos helped his single mother care for younger family members. Phillipos also served on the Cambridge Kids’ Council, a city-sponsored organization that oversees initiatives for children.
“Robel would never knowingly do something wrong,” Kanno-Youngs said.
The revelations Wednesday stunned Kadyrbayev and Tazhayakov’s neighbors at Hidden Brook Apartments in New Bedford. Days after the bombings, authorities descended on the men’s Carriage Drive apartment.
Federal immigration officials arrested the two for allegedly violating their student visas on April 20, and authorities searched their apartment.
“It’s a super quiet neighborhood,” said neighbor Felix Jorge, 31, a father of four young children with another on the way. “If a tree branch falls it’s a big deal. For this to happen, it is monumental.”
He said he did not see the men that often.
“They kept to themselves,” he said. “They seemed like nice kids.”
Wednesday’s criminal charges also stirred more uncertainty at UMass Dartmouth, a 9,000-student campus that has attempted to regain its footing with a barbecue and ice cream socials in the days leading up to final exams.
After Tsarnaev was identified as one of the bombing suspects, authorities evacuated the campus temporarily and later discovered a “large pyrotechnic” in his dorm room.
Raja Nageswaran, 25, a business graduate student from India who knew the Kazakh students and Tsarnaev casually from parties, said that Kadyrbayev and Tazhayakov socialized with other international students, and that he once saw Tsarnaev with them.
“They were definitely fun-loving,” he said of the men. “They loved to party.”
Wednesday, Nageswaran said he was floored by the new allegations. “It’s kind of hard to digest that students who came here to study could do such a thing,” he said.
Officials from the men’s native Kazakhstan, where people in Kadyrbayev’s hometown of Almaty recently held a moment of silence for the bombing victims, appeared in immigration court Wednesday. A lawyer said the nation’s consul in New York had flown in.
Kadyrbayev and Tazhayakov, wearing prison scrubs, appeared at the hearing via teleconference on a big-screen TV from Suffolk County jail. They said little as Judge Steven F. Day set hearings for them later this month.
The initial hearing raised questions about why the men were allowed to stay in the United States if their visas were allegedly invalid, particularly Tazhayakov, who left the United States for winter break, then returned on Jan. 20, after his student visa was canceled Jan. 4.
The discrepancy puzzled the judge, who said, “That doesn’t make any sense.”
Peter Boogaard, a spokesman for the Department of Homeland Security, said Customs and Border Protection officials were not notified that Tazhayakov’s visa was canceled, an issue critics have flagged as a security concern.
But federal officials said students are typically given 30 days to fix their visa status, which Tazhayakov did. University officials suspended him Wednesday because of the criminal charges filed against him, said John Hoey, assistant chancellor for public affairs.
Boogaard said Homeland Security officials have “recently reformed the student visa system to ensure that [Customs and Border Protection] is provided with real time updates on all relevant student visa information.”
Kadyrbayev had his visa canceled in February, a law enforcement official said. He was not pursued for deportation until after the bombings because he did not match Homeland Security’s top priorities, which are terrorism and threats to national security.