Federal prosecutors told jurors that a D.C. man lured his wife’s lover to an apartment building late one evening in January 2011 and fatally beat him in a jealous rage.

But after a two-week trial and nearly two days of deliberations, a D.C. Superior Court jury late Wednesday rejected the prosecution’s theory and acquitted ­42-year-old Melvin Lamond Linkins in the death of 37-year-old D.C. firefighter Marc Emilio Dancy.

It was a challenging case for prosecutors, who told the jury that Linkins used his wife’s cellphone to send text messages to Dancy in a ruse to lure him to an apartment building where Linkins planned to confront him.

But prosecutors were unable to prove several points in their case, including that it was Linkins who sent the text messages and — likely most importantly — that Dancy was killed by a beating.

There were no witnesses or DNA evidence connecting Linkins to Dancy’s death.

D.C. police are investigating the death of Marc E. Dancy, 37, a D.C. firefighter who was found dead in the 3000 block of Seventh St NE on January 23. (Courtesy of DC Police)

Linkins’s attorney, Nikki Lotze, argued that her client was innocent of the charges and that there was no evidence Linkins used his wife’s cellphone to trick Dancy into going to the Northeast Washington apartment. Lotze also said there was no evidence Dancy had been attacked.

Prosecutors did produce a witness who said Linkins had his wife’s cellphone before Dancy’s death.

Dancy’s body was found Jan. 23, 2011, in the vestibule of the apartment building in the 3000 block of Seventh Street NE where the Linkinses lived. The District medical examiner ruled that he died as a result of blunt-force trauma to his body, but the medical examiner could not determine what caused the trauma.

However, two medical examiners who testified for the prosecution said that Dancy’s injuries were consistent with being beaten.

Linkins, who works for United Parcel Service, was arrested in 2013 and charged with second-degree murder. During a preliminary hearing in the weeks after his arrest, a judge ruled that there was not enough evidence to hold Linkins in jail until trial and ordered his release.

Lotze argued that Dancy, whose blood alcohol level showed he was legally drunk at the time of his death, could have been struck by a vehicle after he parked his car or that he could have fallen down the flight of 15 stairs that led to the apartment.

“The government was making too many leaps of faith,” Lotze said.

“There were just too many unknowns in this case, but the one known factor was that my client is innocent and had nothing to do with Mr. Dancy’s death,” she said.

During the trial, evidence suggested that Dancy and Linkins’s wife began an affair in November 2010, two months before Dancy died.

Linkins’s wife, Damali, sat through the trial but, invoking her constitutional spousal privilege, did not testify.

Dancy, who lived in Clinton, Md., was a five-year veteran of the D.C. Fire and Emergency Medical Services in the Trinidad neighborhood. He left behind a wife and three children.