ORLANDO, Fla. — The Orlando killer and his wife exchanged text messages while he was inside a bathroom at the nightclub Pulse, after he’d already killed some of the 49 clubgoers he ultimately shot to death, a law enforcement source said Thursday.

Omar Mateen’s wife, Noor Salman, had told investigators she didn’t know where her husband was at the time of the massacre and said, while she was at home, she had texted him to ask his whereabouts — about two hours after he’d fired the first shot at Pulse, the source said.

Mateen texted her back, asking whether she’d seen the news and knew “what’s happening,” the source said. She said no. She also tried calling him several times on his phone after news of the attack broke, but she told investigators he didn’t answer, the source said.

Story‘Angel’ saved ex-LIer during Orlando shootingEditorialEditorial: Many holes in security against mass killersMore coverageOrlando nightclub shooting

The source said earlier this week that Noor has told the FBI she believed her husband might have been planning an attack and had urged him not to go through with it.

A federal grand jury was convened this week to hear evidence in the case and is expected to weigh possible charges against Salman, the source said.

The source has said the FBI and federal prosecutors are actively working to determine exactly how much Salman and knew about the attack before it happened.

advertisement | advertise on newsday

Also Thursday, it was disclosed that Mateen was posting on Facebook and surfing the Web to see how his bloodbath was playing out in real time online, officials said.

Mateen, 29, had searched for “Pulse Orlando” and “Shooting,” according to a letter released by a federal Senate committee. And he had posted pro-Islamic State and anti-Western missives during and before the killing spree at Pulse nightclub early Sunday.

His posts and searches are among the details surfacing in the days since Mateen unleashed a fusillade of bullets on revelers at the gay-oriented club.

@Newsday

Within 72 hours after the gunfire stopped, the bodies of all 49 of those killed Sunday had undergone autopsies and almost all of them, 47, released to funeral homes that will handle their final affairs, the Orange County Medical Examiner’s Office said Thursday.

The body of Mateen, though, who was shot dead by Orlando police, was set apart from the rest in a separate building, said Chief Medical Director Joshua Stephany.

“His remains are being held in a separate building at the ME facility,” the statement continued. “This is not a law or requirement, but was rather done out of respect for the victims and their families so that the shooter may never be near the 49 beautiful souls again.”

Stephany’s details come as the nation continues to grieve over those killed and the 53 injured by Mateen, who officials say sympathized with Islamic State.

It also comes as officials from local law enforcement authorities to the nation’s highest legislative body probe into the mind and movements of the man now blamed or the worst mass shooting in the nation’s history.

advertisement | advertise on newsday

The Associated Press reported that Senate Homeland Security Committee Chairman Ron Johnson (R-Wisconsin) said Mateen wrote that “real muslims will never accept the filthy ways of the west” on Facebook in the final hours of his life.

Johnson asked Facebook CEO Mark Zuckerburg for help in revealing Mateen’s posts online.

Florida Department of Law Enforcement authorities also released new details about Mateen’s history, including that he made at least two attempts to become a police officer, passing the exams but never being assigned to a force for reason the agency did not reveal, according to the South Florida Sun-Sentinel.

The newspaper reported that Mateen, who had worked for G4S — a security firm based in Jupiter, Florida, for nearly nine years — patrolled the St. Lucie County Courthouse and a gated community in Port St. Lucie.

Meanwhile, the owner of a gun shop in Jensen Beach, a few miles from the gunman’s hometown in Fort Pierce, told reporters Mateen came in roughly five weeks before the nightclub shootings asking to buy body armor and about 1,000 rounds of ammunition.

advertisement | advertise on newsday

Robert Abell, co-owner of Lotus Gunworks in Jensen Beach, says the shop declined the sale because Mateen’s request raised suspicions because it was for body armor typically used by law enforcement.

The victims of the attack continued to recover at area hospitals. Orlando Regional Medical Center, part of the Orlando Health system, said it had treated 44 victims, nine of whom died. The hospital said that it is still treating 23 victims, after discharging 12 of the 35 who survived.

Of the patients in the facility, six are listed in critical condition, three in guarded condition and 14 in stable condition.

— With Henry Pierson Curtis