LAFAYETTE — A man who confessed to beating his girlfriend to death with a baseball bat Tuesday night had been evaluated at a hospital earlier that day after officers, responding to an unrelated incident, learned that he may be mentally unstable, according to an affidavit for warrant of arrest.

Douglas Johnson, 31, is accused of second-degree murder in the killing of Sadairea Rubin, 35, who was found dead inside her apartment at 122 N. Meyers Drive shortly after 10 p.m. Tuesday.

Johnson was taken into custody inside the apartment shortly after officers arrived.

Investigators wrote that he confessed during an interview that he “intentionally repeatedly hit the victim with a bat to kill her,” the affidavit says.

Investigators also noted that Johnson had blood on both of his legs, the affidavit says.

Cpl. Paul Mouton, spokesman for Lafayette Police, said Johnson and Rubin were dating and that Johnson frequently stayed at Rubin’s apartment.

He said Rubin was not around earlier in the day when Lafayette police responded to a separate call at the apartment involving Johnson.

At 9:40 a.m., officers responded to the apartment in reference to a man who kicked in a neighbor’s door after he heard what sounded like “a body fall to the ground,” the affidavit says.

A woman, inside the residence with her child, did not wish to pursue charges, Mouton said.

However, officers brought Johnson to the University Medical Center to be evaluated because his behavior was “very unusual,” Mouton said.

The affidavit says that an Order of Protective Custody was executed at the hospital.

Johnson was released at 2 p.m. and returned to the apartment, the affidavit says.

Mouton said he did not have information on why Johnson was released from the hospital, and “as you know, I cannot speak on their behalf.”

At 7:30 p.m. Johnson called a taxi to bring him to Baton Rouge, the affidavit says.

While on the way there, Johnson received a phone call and asked to be brought back to Lafayette, the affidavit says.

A woman, believed to be the victim, flagged Johnson down at a gas station near Interstate 10 and Ambassador Caffery Parkway, the affidavit says.

The taxi driver said Johnson then exited the vehicle and got into another vehicle with the woman, the affidavit says.

Less than three hours later, Johnson called the Lafayette Police Department and then made several calls to 911, stating that he was with the victim “who was dead and not breathing,” the affidavit says.

The case remains under investigation, Mouton said.