John Raoux / AP An FBI investigator walks to the apartment where a man was shot by an FBI agent, on May 22, in Orlando, Fla.

Dead Boston bombing suspect Tamerlan Tsarnaev and another man — who was killed by the FBI on Wednesday — murdered three people in Massachusetts after a drug deal went wrong in 2011, law enforcement sources tell NBC News.

Sources say that what began as a drug ripoff ended in a triple homicide when Tsarnaev and friend Ibragim Todashev realized their victims would later be able to identify them.

Todashev was killed by a federal agent while giving a statement on his role on Wednesday in Orlando, Fla.

The man who was shot, Todashev, 27, allegedly attacked an agent with a knife while confessing to the slayings. He was not suspected of having played any role in the bombing that killed three people and injured scores more in April, but he did confess to being involved in a brutal Boston-area slaying two years ago, investigators said.

AP Photo / Orange County Corrections Department In this May 4, 2013 police mug provided by the Orange County Corrections Department in Orlando, Fla., shows Ibragim Todashev after his arrest for aggravated battery in Orlando.

Law enforcement officials said Todashev was being questioned as part of the FBI’s effort to find and talk to anyone who had any contact with Tsarnaev, the older bombing suspect killed in a shootout with police.

The shooting occurred in the early morning hours on Wednesday, the FBI said in a statement.

“The agent, two Massachusetts State Police troopers, and other law enforcement personnel were interviewing an individual in connection with the Boston Marathon bombing investigation when a violent confrontation was initiated by the individual,” the statement said.

“During the confrontation, the individual was killed and the agent sustained non-life threatening injuries,” according to the statement.

It's not clear who shot Todashev, officials say, because -- while he was being questioned by an FBI agent -- officers from the Massachusetts state police and the Orlando police department were also present in the house where the interrogation was going on.

Todashev, they say, had spent some time in the Boston area, where he was a mixed martial arts fighter, and knew Tsarnaev there. Investigators say he confessed to the agent in Florida that he played a role in a triple murder in 2011 in which three men were discovered slain in an apartment in Waltham, Mass.

Brendan Mess, 25; Raphael Teken, 37; and Eric Weissman, 31, were found with their throats cut in September of 2011, and their bodies were covered with marijuana. No suspects had been arrested in that case.

A spokesperson for the Middlesex County District Attorney’s office, which is investigating the three deaths, said that the office does not discuss ongoing investigations. Relatives for the three men did not immediately return requests for comment.

Officials say FBI agents were questioning Todashev on Tuesday. He was cooperative at first, they say, but later that night, he attacked the agent with a knife. Officials say Todashev became violent as he was about to sign a written statement based on his confession.

A man officials say knew the bombing suspect, Tamerlan Tsarnaev, was shot and killed in Orlando, Fla., when he allegedly attacked an FBI agent who traveled to Orlando to interview him. NBC's Pete Williams reports.

The officials say Todashev had some connections with radical Chechen rebels, but they say it's not clear whether he had any role in radicalizing Tsarnaev.

A friend of Todashev told NBC News affiliate WESH that he was being questioned along with the man who was shot due to their connections to the mixed martial arts community in Boston.

“They were talking to us, both of us, right? And they said they need him for a little more, for a couple more hours, and I left, and they told me they’re going to bring him back. They never brought him back,” friend Khusn Taramiv, 27, told WESH.

Todashev was arrested for aggravated battery on May 4, 2013 after getting into a fight over a parking spot with another man at Premium Outlets in Orlando, according to an Orange County Sheriff’s Office arrest affidavit.

Todashev said that he pushed the other man after he “got into his face,” according to the affidavit. The man’s son then “came at him swinging,” Todashev told police. The 5’9”, 160-pound Todashev admitted to police that he was a former mixed martial arts fighter, according to the arrest affidavit.

“This skill puts his fighting ability way above that of a normal person,” the arresting officer wrote in the affidavit.

Todashev was transported to the booking and release center without incident, according to the affidavit. His Miranda warning was read but not invoked, the document says. He was released May 5 on a $3,500 surety bond, according to the Orange County Corrections Department.

The man was born in Russia and had U.S. citizenship, according to the affidavit.

A spokesman for the Orlando Police Department referred all questions regarding the shooting to the FBI.

An FBI incident review team was dispatched from Washington, D.C., and was expected to arrive in Orlando within 24 hours, FBI Special Agent Dave Couvertier said on Wednesday morning.

Todashev was also arrested in downtown Boston in 2010 following a fender bender involving his van and a car carrying two women. Todashev had to be restrained by witnesses after he aggressively confronted the women, the Suffolk County District Attorney's office told NBC affiliate WHDH. Witnesses said Todashev was clearly the aggressor, and there was physical contact between everyone involved.

However, authorities say there were no injuries and no charges were pressed.

Todashev had been in the country since 2006.

Related:

NBC's Andrew Rafferty contributed to this report

This story was originally published on