Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The gunman who killed 49 people at an Orlando gay nightclub Sunday sent a text message to his wife during the rampage, asking "do you see what’s happening?" a source close to the family told NBC News Thursday.

The texts between Omar Mateen and his wife, Noor Zahi Salman, during the attack on the Pulse nightclub were first reported by CNN. Mateen, 29, was later killed in a shootout with police.

Related: First Funerals Held for Orlando Victims

The source close to Salman said Mateen’s mother called Salman at around 2 a.m. Sunday, waking her up and asking if she knew where Mateen was.

Salman said she did not know, and texted her husband: "Where are you?" the source said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Mateen responded: "Do you see what’s happening?"

Salman replied "No?" according to the source.

Mateen then responded "I love you, babe."

Noor Mateen and her husband Pulse gunman, Omar Mateen, from a Facebook profile photo. via Facebook

Related: Orlando Gunman's Wife Feared He Would Attack Gay Nightclub

A federal law enforcement official confirmed that Mateen and his wife exchanged text messages at around 2:30 a.m. Afterward, she repeatedly tried to call him on his cell phone, the official said.

Salman was told what happened at 4 a.m., when police called Salman and told her to come out of the home she shared with Mateen with her hands up, the source close to her said.

Mateen opened fire at the club at around 2 a.m., officials said. An off-duty Orlando officer responded to the gunfire and exchanged fire with Mateen at 2:02 a.m., and Mateen took hostages.

Related: Senators Want Orlando Gunman Omar Mateen's Facebook Info

Mateen was killed in a shootout with police after authorities used an explosive charge and an armored vehicle to punch a hole a bathroom wall at around 5 a.m., authorities said. Hostages escaped through the breach. Mateen also emerged through the hole with a long gun and and a handgun and was killed in a gun battle, police said.

The attack is the deadliest mass shooting in modern American history. President Barack Obama called it an act of terrorism. Mateen called 911 and pledged allegiance to the terror group ISIS and referenced the Boston marathon bombers as he held hostages, FBI Director James Comey has said, but a motive has not been determined.

Related: President Obama Says Nation and Orlando 'Shaken by an Evil, Hateful Act'

Salman is cooperating with investigators and has volunteered to take a polygraph test, the source close to her said. She is in the process of hiring attorneys to represent her, according to the source.