WASHINGTON — With global markets shaken by President Donald Trump's surprise decision to impose strict tariffs on steel and aluminum imports, the president went into battle mode on Friday: "Trade wars are good, and easy to win," he wrote on Twitter.

But the public show of confidence belies the fact that Trump's policy maneuver, which may ultimately harm U.S. companies and American consumers, was announced without any internal review by government lawyers or his own staff, according to a review of an internal White House document.

According to two officials, Trump's decision to launch a potential trade war was born out of anger at other simmering issues and the result of a broken internal process that has failed to deliver him consensus views that represent the best advice of his team.

On Wednesday evening, the president became "unglued," in the words of one official familiar with the president's state of mind.

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

A trifecta of events had set him off in a way that two officials said they had not seen before: Hope Hicks' testimony to lawmakers investigating Russia's interference in the 2016 election, conduct by his embattled attorney general and the treatment of his son-in-law by his chief of staff.

Trump, the two officials said, was angry and gunning for a fight, and he chose a trade war, spurred on by Commerce Secretary Wilbur Ross and Peter Navarro, the White House director for trade — and against longstanding advice from his economic chair Gary Cohn and Treasury Secretary Steve Mnuchin.

Ross had already invited steel and aluminum executives to the White House for an 11 a.m. meeting on Thursday. But Ross, according to a person with direct knowledge, hadn't told the White House who the executives were. As a result, White House officials were unable to conduct a background check on the executives to make sure they were appropriate for the president to meet with and they were not able to be cleared for entry by secret service. According to a person with direct knowledge, even White House chief of staff John Kelly was unaware of their names.

By midnight Wednesday, less than 12 hours before the executives were expected to arrive, no one on the president's team had prepared any position paper for an announcement on tariff policy, the official said. In fact, according to the official, the White House counsel's office had advised that they were as much as two weeks away from being able to complete a legal review on steel tariffs.

In response to NBC News, another White House official said that the communications team "was well-prepared to support the president's announcement" and that "many of the attendees had been in the White House before and had already been vetted for attendance at a presidential event." A different official said of the decision, "everyone in the world has known where the president's head was on this issue since the beginning of his administration."

There were no prepared, approved remarks for the president to give at the planned meeting, there was no diplomatic strategy for how to alert foreign trade partners, there was no legislative strategy in place for informing Congress and no agreed upon communications plan beyond an email cobbled together by Ross's team at the Commerce Department late Wednesday that had not been approved by the White House.

No one at the State Department, the Treasury Department or the Defense Department had been told that a new policy was about to be announced or given an opportunity to weigh in in advance.

The Thursday morning meeting did not originally appear on the president's public schedule. Shortly after it began, reporters were told that Ross had convened a "listening" session at the White House with 15 executives from the steel and aluminum industry.

Then, an hour later, in an another unexpected move, reporters were invited to the Cabinet room. Without warning, Trump announced on the spot that he was imposing new strict tariffs on imports.

By Thursday afternoon, the U.S. stock market had fallen and Trump, surrounded by his senior advisers in the Oval Office, was said to be furious.