An FBI agent fatally shot a Florida man this morning, after questioning him about ties to Boston Marathon bomber Tamerlan Tsarnaev, authorities said.

Feds, two Massachusetts state troopers and investigators from other agencies were questioning Ibragim Todashev, 27, shortly after midnight when he suddenly pulled a knife and stabbed an FBI agent, law enforcement sources told The Post.

It wasn’t immediately clear if the stabbed FBI agent was the same one who shot and killed Todashev. The wounded FBI agent was taken to the hospital and he was expected to survive his wounds, officials said.

Todashev was being interviewed at his Orlando apartment about his connections to Tamerlan and Dzhokhar Tsarnaev, officials said. Todashev apparently knew Tamerlan Tsarnaev through their connections in mixed martial arts.

“A violent confrontation was initiated by the individual,” an FBI official told The Post.

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

An FBI post-shooting review team has already been sent to Orlando, and Todashev’s Windhover Condominiums on Peregrine Avenue.

In recent days, Massachusetts cops had been talking to Todashev about a Sept. 11, 2011 triple slaying in Waltham that might be connected to Tamerlan Tsarnaev, law enforcement sources told The Globe.

The three Waltham victims had their throats slashed and marijuana was dumped on their bodies, in a possible drug-rival hit.

“Both Tsarnaev and Todashev were suspects in the murders,’’ one official said.

One of Todashev’s friends and neighbors, Khusn Tarami, told Orlando TV station WESH today that he too was interviewed by FBI agents.

“[The FBI] took me and my friend, the suspect that got killed. 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,” Taramiv said.

“He [Todashev] felt inside he was going to get shot. I told him, ‘Everything is going to be fine, don’t worry about it.’ He said, ‘I have a really bad feeling.’ “

Taramiv insisted he and Todashev had no connection to the April 15 bombings at the Boston Marathon finish line.

Tamerlan Tsarnaev was killed in a shootout with police less than four days after the marathon blasts that killed three spectators.

The dead terrorist’s little brother Dzhokhar Tsarnaev was nabbed later that day and has been charged with using weapons of mass destruction.

“The FBI kept asking, ‘What’s the connection?’ But there is no connection… no connection,” Taramiv told MyFoxOrlando.

Taramiv said the victim had planned to return to Chechnya but canceled his tickets.

“Me and him and my friends, we knew this was going to happen. That’s why he wanted to leave the country,” Taramiv said. “But he canceled the tickets. The FBI’s been pushing him, ‘Don’t leave, don’t leave.’ So he decided to stay.”

Taramiv said he found about the shooting after returning to his apartment: “I was completely shocked. I still can’t believe it, you know what I mean?”

Todashev was arrested earlier this month at an Orlando shopping mall, fighting over a parking spot.

He squared off against a 54-year-old man and his 35-year-old son, splitting the lip and knocking out teeth of the younger man, according to Orange County Sheriff’s deputies.

“Also by his own admission Todashev was recently a former mixed martial arts fighter,” the arresting deputy wrote in his report.

“This skill puts his fighting ability way above that of a normal person.”

Todashev was released on $3,500 bond following the May 4 attack.

With Post Wire Services and additional reporting by David K. Li

FOX 35 News Orlando