Will and Grace star Debra Messing has come under fire after posting a selfie that was meant to bring awareness to gun violence in America amid news of the UCLA campus shooting.

As news broke about the tragic murder-suicide at UCLA's engineering school on Wednesday, Messing shared a photo of her wearing shirt that read 'Under the Gun,' the title of Katie Couric's new gun violence documentary.

The 47-year-old's now-deleted tweet also included the caption: 'HORRENDOUS Watching news about shooting at UCLA with casualties while taking selfie 2bring awareness to Gun Violence.'

Scroll down for video

Will and Grace star Debra Messing drew ire on Twitter on Wedneaday after posting a selfie (pictured) that was meant to bring awareness to gun violence in America amid news of the UCLA campus shooting

Twitter users were quick to call the actress out (shown above), criticizing her for posting the selfie

One Twitter user wrote tweeted at Messing: 'People dying... better take a selfie!' (shown above)

Twitter users quickly hit out at the actress, criticizing her for posting the selfie with some calling her a 'narcissistic, self-absorbed celebrity,' according to the New York Daily News.

'Ima talk about the senselessness of gun tragedies, but 1st a pensive airbrushed selfie to convey the seriousnes of it~shorter @DebraMessing,' user LMR wrote.

'People dying...better take a selfie!' another user, Lazarus Stalker, wrote.

'You didn't think this through did you,' Twitter user suburban dad tweeted at The Mysteries of Laura actress.

Messing deleted the tweet after she was faced with backlash and apologized as she wrote 'Take a stand. This day was predetermined as a day of awareness. Don't belittle the effort. #wecandobetter'

She then posted several tweets explaining she had shared the selfie as part of the pre-planned day of advocacy meant to bring awareness to gun violence in America.

'We were all asked to a post a picture today wearing this t-shirt. AS I took the picture, the news broke about the shooting at UCLA,' Messing wrote.

'I was so shocked and struck by the horrible IRONY that yet another shooting was occurring as I was participating in this effort.

'In an effort to highlight the irony, I posted a picture referencing the breaking news.

'I am heartbroken and embarrassed that so many people misconstrued my actions and that I caused offense. That’s the last thing I want to do.

'The horrendous irony of the timing, I was hoping, would shine an even brighter light on the crisis and need for all of us to do something together to make the US safer.

'I am so truly sorry. #wemustdobetter'

Messing removed the tweet after she was faced with backlash and apologized as she wrote 'Take a stand. This day was predetermined as a day of awareness. Don't belittle the effort. #wecandobetter'

She then shared a note on Twitter explaining she had shared the selfie as part of the pre-planned day of advocacy meant to bring awareness to gun violence in America

In one tweet she responded to someone saying the incident was not about Katie Couric. It is 'about bringing awareness to a very real crisis in the US. Too many people dying'

One young woman tweeted at Messing thanking her for her efforts in bringing awareness to the gun violence.

'As a survivor of a gun crime, I thank you for your efforts to bring awareness to the crisis,' user Caileigh Scott wrote.

Messing replied: 'Just trying to do what I can. But clearly human. Made a mistake. Still believe in the effort.'

National Gun Violence Awareness Day is on Thursday, a nationwide movement made popular by the nonprofit Everytown for Gun Safety, which sees people wear orange in solidarity as they honor the lives of people cut short by gun violence.

The day was initially started in honor of 15-year-old Chicago high school student Hadiya Pendleton who was shot and killed in 2013.

Her friends wore the color orange to remember her life and chose it because it is the color hunters wear in the woods to protect themselves and others.

On Wednesday, hundreds of heavily armed officers swarmed the sprawling UCLA campus following the shooting that forced thousands to barricade themselves in classrooms and offices, some using belts and chairs to secure doors, until authorities determined the gunman and the professor he shot were dead.

On Wednesday, hundreds of heavily armed officers swarmed the sprawling UCLA campus following the shooting. A third year student is shown emotional as she calls her mother, telling her not to worry

FBI officers are pictured at the scene on Wednesday. Two people were confirmed dead following the tragic ordeal

An emotional student is pictured on the campus following the shooting. William S. Klug, a professor of mechanical engineering, was gunned down in an engineering building office, according to authorities

About two hours after the first 911 call came in around 10am, with the center of campus still saturated with officers, Los Angeles Police Chief Charlie Beck said it was a murder-suicide and declared the threat over.

Two men were dead, and authorities found a gun and what might be a suicide note, he said.

William S. Klug, a professor of mechanical engineering, was gunned down in an engineering building office, according to a law enforcement official.

The official has knowledge of the investigation but was not authorized to publicly discuss it. The shooter has not yet been identified.

Colleagues of Klug's told The Associated Press he was a married father of two and a kind, gentle person.

UCLA biology and chemistry Professor Charles Knobler said those who knew Klug are in shock. He described the professor as "a very lively, lovable, likable guy."

The response to the shooting was overwhelming: Teams of officers in helmets and bulletproof vests looking for victims and suspects ran across the normally tranquil campus tucked in the city's bustling west side.

Some with high-powered rifles yelled for bystanders to flee.

Groups of officers stormed into buildings that had been locked down and cleared hallways as police helicopters hovered overhead.

The shooting occurred the week before final exams at the University of California, Los Angeles, whose 43,000 students make it the largest campus in the University of California system.