Sean Collier’s dream was to become a Somerville police officer, according to Mayor Joe Curtatone. And he was weeks away from realizing that dream.

But Collier, a Somerville resident and MIT police officer, was shot in the line of duty Thursday night by the men believed to be behind the Boston Marathon bombings.

“It’s shocking, surreal, unfathomable,” Curtatone told the Journal.

Only an hour after leaving a vigil for the victims of the bombings at Somerville City Hall Thursday night, Curtatone heard from Somerville Police Chief Thomas Pasquarello that Collier had been shot. Collier was found shot in his police car on the MIT campus at the corner of Vassar Street and Main Street in Cambridge. He was transported to Massachsuetts General Hospital, where he was pronounced dead.

Curtatone said Somerville police had “a presence” at the hospital last night.

“My heart goes out to [Collier’s] family,” he said. “I can’t imagine their amount of grief.”

In a joint statement, Curtatone and Pasquallero praised Collier's dedication to the community.

“Our hearts are broken today, as we learn about the death of one of our own, Sean Collier," the statement read. "Sean had been a dedicated civilian employee in the Somerville Police Department, working to become a Somerville Police Officer. Sean was a tremendous young man, and we grieve for his family and friends in Somerville, and in our Department. Similarly, we grieve for the families and friends of all victims of this week’s acts of senseless violence, and hope that we can continue to unite in support of all affected.”

The men suspected of shooting Collier, Cambridge brothers Dzhokhar and Tamerlan Tsarnaev, carjacked a man driving a Mercedes and fled to Watertown, and reportedly shot and threw explosives at pursuing police. Tamerlan Tsarnaev was killed in the fight and the Boston metro area is on lockdown as thousands of officers, including ones from Somerville, search for Dshokhar Tsarnaev.

Curtatone said Collier would soon have been a Somerville police officer. Collier joined the department’s auxiliary police force in 2008 and worked in information technology, helping to set up the department’s website. He was appointed to the MIT police force at the beginning of the year but had applied to be on the city’s police force, and his appointment was as good as confirmed, Curtatone said.

“He was an outstanding candidate and an outstanding human being … it would’ve been a matter of weeks at the most,” Curtatone said. “He would’ve been an outstanding officer.”

Collier grew up in Wilmington and graduated high school there, later attending Salem State University. But he moved to Somerville five years ago and became an immediate part of the Somerville community, Curtatone said. He set up the website for the Somerville Boxing Club, and after joining the MIT force would come in on days off to work on the SPD website.

Page 2 of 2 - “He wanted to be in the Somerville Police Department,” Curtatone said. “It was his dream to do that.”

One of the three fatalities in the Marathon bombings, Krystle Campbell, formerly lived in Somerville and had strong Somerville ties. Many of the several hundred people at Thursday’s vigil came out in support of her family, and Curtatone said it was terrible to come from a show of support like the vigil to news that a Somerville man had been killed by the alleged perpetrators of the bombing.

“This tragedy keeps digging deeper and hitting home,” he said.

MIT officials praised Collier Friday.

“Sean was one of these guys who really looked at police work as a calling,” said MIT Police Chief John DiFava of Collier, who was 26. “He was born to be a police officer.”

“In a very short period of time, it was remarkable how engaged he was with students, particularly graduate students,” DiFava said. He added that Collier had become active with the MIT Outing Club, joining students in skiing and hiking.

Collier had served as a member of the MIT Police since Jan. 9, 2012, following service as a civilian employee with the Somerville Police Department. He was single and a native of Wilmington, Mass. He graduated from Salem State University in 2009 and joined the Somerville Police Auxilary Department that year as a records clerk.

DiFava said Collier was highly involved with MIT’s student population.

“The loss of Officer Collier is deeply painful to the entire MIT community,” said MIT President L. Rafael Reif. “Our thoughts today are with his family, his friends, his colleagues on our police force and, by all accounts, the many other members of our community who knew him. This is a senseless and tragic loss.”

“The MIT Police serve all of us at the Institute with great dignity, honor and dedication,” said Israel Ruiz, MIT’s executive vice president and treasure. “Everyone here — those who knew Officer Collier, and those who did not — are devastated by the events that transpired on our campus last night. We will never forget the seriousness with which he took his role protecting MIT and those of us who consider it home.”