WASHINGTON — Members of President Donald Trump’s coronavirus task force and aides in the West Wing were shocked on Thursday when he promoted the use of light and disinfectant to treat the deadly respiratory illness, according to administration officials.

As Trump went off script to suggest people with the virus could be cured by UV rays or disinfectants “by injection inside,” White House officials began texting one another to ask where he got that idea because they thought, as one adviser put it, “this was going to be bad.”

None of them seemed to know, as Trump did not consult with any task force members or administration officials before making his impromptu statement, which has now been universally rejected by health experts, the officials said.

Instead, it appears Trump conflated and misinterpreted scientific information discussed with him in the Oval Office before Thursday’s daily briefing, according to the officials.

During the meeting some advisers — including the acting undersecretary for science and technology, Bill Bryan — shared with the president some new but promising information about testing that’s been done on coronavirus, officials said. It included a discussion about how the virus is killed on surfaces with disinfectants and on hands with soap or sanitizer and studies about the effectiveness of light, temperature and humidity, as well as a mention of treatments for various conditions such as radiation, officials said.

The plan was to stress during the daily White House coronavirus briefing that disinfectants should be used on surfaces, but then “the president took it a couple steps further,” one administration official said.

“It was totally ad-libbed,” the official said, adding, it was “off-the-cuff.”

Download the NBC News app for full coverage of the coronavirus outbreak

“I think what he did was conflate the disinfecting product with heat and light," the official said. "They are not the same things. The disinfectants are for surfaces.”

Another administration official said Trump took the briefing information on disinfectant and sunlight and appeared to do some “deductive reasoning” that it could be injected into people.

The first official stressed that Trump did not intend to suggest people should inject disinfectants into their bodies, and that the president’s comments stem from his desire to project optimism about the future of the pandemic.

“He wants to always be giving people hope and optimism. He certainly isn’t telling anyone to drink bleach or ingest disinfectant,” the official said.

On Friday Trump told reporters he was being sarcastic when he suggested people inject disinfectant into their bodies.

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

It’s not the first time the president has claimed that his attempted “jokes” were being misinterpreted after facing intense backlash and widespread criticism. When he referred to himself to reporters as “the chosen one” during an exchange on trade talks with China last year, he argued later that he had just been “kidding” and “having fun.” During the 2016 campaign, after repeatedly saying that then-President Barack Obama was the “founder of ISIS,” he backtracked by saying he was simply being “sarcastic.”

Medical officials cast Thursday’s presidential twist on scientific information as perhaps his most dangerous and misleading attempt yet to project a positive outlook on the coronavirus pandemic.

On Friday the Maryland Emergency Management Agency issued an alert that it had “received several calls regarding questions about disinfectant use” and the coronavirus, warning residents that “under no circumstances should any disinfectant product be administered into the body.”

But Trump’s promotion of light and disinfectant as a possible hope for curing a virus that’s killed some 50,000 Americans is part of a broader posturing that’s designed to make the country feel like the current situation is improving or soon will, officials said.

They said Thursday’s remarks are part the president's increasing irritation at his health advisers’ constant caution about possible treatments that he wants to promote and warnings about a future wave of the coronavirus. Even if Trump factors their advice into his scripted remarks, they can’t be sure he won’t ad lib to overcorrect what he sees as pessimistic guidance.

A day before suggesting light and disinfectant might cure the coronavirus, Trump played down warnings from health officials about a new wave of the pandemic in the fall. Instead he highlighted how parts of the country are reopening and restrictions designed to curtail the pandemic are easing. Officials said the president is frustrated that health officials are sounding alarms about a wave of new infections in the fall at a time when he’s trying to show the country is moving past the current one.

“I think when the president said it won’t come back in the fall, he meant the same intensity,” an administration official said.

But Trump said Wednesday that the coronavirus “may not come back at all” this fall, even though officials said he’s been shown projections that are not nearly as positive as he purports.

“The forecasts are bad,” one person familiar with the president’s briefings said.

At Thursday’s briefing, after Bryan, the homeland security undersecretary, finished a presentation of initial findings into how heat and sunlight may affect the virus, the president took to the lectern to offer his own take on the science.

“Supposing we hit the body with a tremendous, whether it's ultraviolet or just a very powerful light, and I think you said that hasn't been checked but you’re going to test it,” Trump said, referring back to Bryan, and looking to his right for approval from the task force coordinator, Dr. Deborah Birx.

Birx sat silently, hands clasped, looking forward, before shifting her eyes downward. She did not offer any other reaction as the president continued to muse.

Full coverage of the coronavirus outbreak

“And then I said, supposing you brought the light inside the body, which you can do either through the skin or in some other way, and I think you said you're going to test that, too. It sounds interesting,” Trump said, as he kept looking over at Birx, who remained stone-faced.

“I see the disinfectant that knocks it out in a minute, one minute. And is there a way we can do something like that by injection inside or almost a cleaning? As you see, it gets in the lungs, and it does a tremendous number on the lungs, so it would be interesting to check that, so that, you’re going to have to use medical doctors with,” he conceded.

Though Trump has repeatedly said “I’m not a doctor,” that hasn’t stopped him from quizzing his own medical professionals on whether certain unproven treatments might work for the coronavirus.

Later, the president posed the question to Birx: “Deborah, have you ever heard of that? The heat and the light, relative to certain viruses, yes, but relative to this virus?”

“Not as a treatment,” she replied.

Some administration officials thought the White House press office should have clarified the president’s statements Thursday night after he made them. But one official said, “No one told him you need to clean this up.”

Instead it took the new White House press secretary, Kayleigh McEnany, more than 12 hours to clarify the remarks.

“President Trump has repeatedly said that Americans should consult with medical doctors regarding coronavirus treatment, a point that he emphasized again during yesterday’s briefing. Leave it to the media to irresponsibly take President Trump out of context and run with negative headlines,” she said in a statement, despite the president’s own embrace of the potential therapies.

Notably, McEnany did not say the president was being sarcastic.

Friday morning, Surgeon General Jerome Adams also had to clean up the president’s musings, without directly referring to them. He implored all Americans to consult health care providers first before self-administering any treatment or medication to themselves or loved ones.

“Your safety is paramount, and doctors and nurses have years of training to recommend what’s safe and effective,” he tweeted.