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

The Department of Treasury sent a letter to the Office of Government Ethics Friday addressing comments made by Treasury Secretary Steven Mnuchin where he appeared to endorse the Lego Batman movie, NBC News has learned.

The comments spurred backlash from ethics critics and Democrats who said Mnuchin's endorsing the film, for which he was an executive producer, violated his ethics clause.

Mnuchin writes in the letter, sent to Walter Shaub at the Office of Government Ethics, that he "should not have made that statement" and assured the OGE that "it was not my intention to make a product endorsement." He points out that when asked a similar question in a later interview, he did not respond with mention of the Lego Movie.

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

"I take very seriously my ethical responsibilities," Mnuchin's letter goes on to say, and reassures that in the future he will "exercise greater caution to avoid any suggestion that I do not take these important rules seriously."

A Treasury spokesman adds in a statement to NBC News that "The Secretary's responses were made in jest and not intended to be a product endorsement of the Lego Batman movie. We think that's clear in context."

During an interview with Axios last week, the Treasury Secretary was asked about his favorite movie and at first declined to give his preference. "I'm not allowed to promote anything that I'm involved in. So I want to have that legal disclosure," he said at the time. "You've asked me a question and I'm not promoting any product."

Then he added the punchline: "But you should all send your kids to Lego Batman."

The Office of Government Ethics did not immediately respond to a requests for comment.

Government watchdog group Citizens For Responsibility and Ethics in Washington (CREW) was heartened by the news. Communications Director Jordan Libowitz called the letter "the kind of thing we hope to see after a situation like this."

Mnuchin's acknowledgement of his mistake and the seriousness with which he took the action "shows he's playing by the rules," Libowitz added.

The Treasury head's reaction stands in stark contrast to that of fellow administration official Kellyanne Conway who was given no penalties after she urged Fox viewers to "go buy Ivanka's stuff" after Nordstrom announced it was dropping her line. "Ideally we wouldn't have either situation," the CREW communications director said. "But when they do, what we've seen with Mnuchin is the way to deal with them."