Receive the latest politics updates in your inbox

A White House staffer is out of a job after posting hundreds of critical anonymous tweets about his bosses. (Published Wednesday, Oct. 23, 2013)

The White House staffer who was fired for posting snarky, critical tweets through an anonymous Twitter account has apologized for what he calls "inappropriate and mean-spirited comments."

In an email to NBC's Ali Weinberg, Jofi Joseph, the former director in the non-proliferation section of the National Security Council apologized for creating the "parody" account.

"I bear complete responsibility for this affair and I sincerely apologize to everyone I insulted," Joseph wrote.

For the last two and a half years, Joseph posted tweets that criticized government policies and his bosses, including President Barack Obama, the Daily Beast reported. Joseph also openly criticized Republican figures.

Joseph added in his apology, "It has been a privilege to serve in this Administration and I deeply regret violating the trust and confidence placed in me."

While the White House has not confirmed the details of the tweets, other sources have, NBC News' Chuck Todd confirmed.

Daily Beast senior correspondent Josh Rogin was among those who believed the anonymous @natsecwonk was an insider.

"His Twitter feed was a mix of leaking sensitive national security information, criticizing the policies of the administration he worked for and insulting the personalities and appearance of very famous national security officials," Rogin said during an interview on NBC's "Today" show.

In his Twitter bio, Joseph listed himself as a keen observer of the national security scene who was unapologetic in saying what everyone else only thought. He was fired last week, NBC Washington has learned.

According to Rogin, White House and State department officials worked for months to uncover @NatSecWonk's true identity. The search intensified after he tweeted repeatedly about his doubts on the official accounts on the attack in Benghazi.

There's no word on how his termination will impact his wife, who also has a high-profile job on Capitol Hill.