Mercedes Schlapp, the White House's director of strategic communications, posted a number of tweets in 2015 strongly critical of Donald Trump and his agenda, assailing the then-presidential candidate for his hardline immigration rhetoric, his attacks on Senator John McCain and then-Fox News host Megyn Kelly, and his pledge to get along with Russian President Vladimir Putin, among other things.

The revelation of Schlapp's critical Trump tweets, which have not previously been reported, comes two days after CNN discovered other years-old tweets in which Schlapp appeared to oppose the idea of a US president's meeting with Kim Jong Un, the North Korean dictator -- something Trump did earlier this week.

News of Schlapp's commentary critical of Trump also comes as the White House works to restructure its communications office. CNN reported last week that the White House is poised to purge lower level staffers from the communications office and that Sarah Sanders, the press secretary, has told friends she does not intend to remain in her position indefinitely.

Related: White House poised to purge lower-level communications staffers

Through a White House spokesperson, Schlapp released a statement to CNN on Thursday afternoon in which she praised Trump, but declined to address her history of commentary critical of him and his agenda.

"President Donald Trump led an unprecedented political revolution and his passionate advocacy for the forgotten men and women of this country inspired me to proudly support him, fight for him every day, vote for him, and join this White House," Schlapp said. "As President, his policies have forever changed my life and that of the hundreds of millions of Americans for the better. I am deeply honored to work for this President and am 100% supportive of him, his vision, his policies and his legislative agenda."

Immigration

Some of the most pointed criticism Schlapp, who is of Cuban descent, directed at Trump was about the uncompromising anti-immigration platform on which he campaigned during the 2016 election.

In August 2015, just two months after Trump ignited controversy when he launched his presidential bid saying Mexico was "not sending their best" and instead "sending people that have lots of problems" with drugs and crime, Schlapp tweeted that she was "not sure" how Trump "will lead with Latinos" in the 2016 election.

Not sure how #DonaldTrump will lead with Latinos. — Mercedes Schlapp (@mercedesschlapp) August 12, 2015

Days later, Schlapp wrote, "One way to lose the Latino support is by saying that U.S. needs to deport all undocumented immigrants #DonaldTrump."

One way to lose the Latino support is by saying that U.S. needs to deport all undocumented immigrants #DonaldTrump — Mercedes Schlapp (@mercedesschlapp) August 17, 2015

"Has #DonaldTrump seen the latest poll numbers?" Schlapp asked in another tweet. "@GallupNews 65% of hispanics view Trump unfavorably. Time to change his rhetoric?"

Has #DonaldTrump seen the latest poll numbers? @GallupNews 65% of hispanics view Trump unfavorably. Time to change his rhetoric? — Mercedes Schlapp (@mercedesschlapp) August 24, 2015

In July 2015, Schlapp wrote a column for US News & World Report in which she said Trump "needs to apologize" and "take back his remarks about Mexicans, for the good of his own campaign and the GOP."

In the column, Schlapp called his approach "short-sided [sic] and harmful to the Republican Party," writing that he "may want to tug at the emotional strings of some by stating that he would create a big wall and have Mexico pay for it, but Trump is also creating fear among Americans without offering a thoughtful and realistic solution to the growing problem of the U.S. immigration system."

In September 2015, Schlapp tweeted it was "not financially practical to deport all of illegals."

In November 2015, she derided the GOP for "ant [sic] immigration talk." In that tweet, she also praised Jeb Bush, who Trump criticized as weak on the issue, as "right on immigration."

Megyn Kelly and John McCain

Schlapp came to the defense of both Kelly and McCain, knocking Trump for rhetoric she deemed to be out of bounds.

When Kelly, the former Fox News host who made headlines in August 2015 for pressing the real estate mogul on his treatment of women during the first Republican primary debate, drew Trump's ire, Schlapp rushed to provide her support.

Schlapp tweeted that Trump "should not go after" Kelly, after Trump told the then-Fox News host during the August debate that he had been "very nice" to her, but "could probably maybe not be, based on the way you have treated me." Schlapp said that night the attack was "annoying" and a couple days later deemed it a "losing strategy."

#donaldtrump picking a fight with @megynkelly is a losing strategy — Mercedes Schlapp (@mercedesschlapp) August 8, 2015

When later in the month Trump attacked Kelly and retweeted a supporter calling her a "bimbo," Schlapp seemed upset.

"Dear @megynkelly, can't wait for your response tonight. Pls put #DonaldTrump in his place," Schlapp tweeted.

Dear @megynkelly, can't wait for your response tonight. Pls put #DonaldTrump in his place. — Mercedes Schlapp (@mercedesschlapp) August 25, 2015

In another tweet, Schlapp wrote, "I'm wondering if #DonaldTrump would ever call one of the male journalist a bimbo. Double standard?"

Schlapp also zinged Trump for his attack on McCain, the Senator from Arizona and former Republican nominee for president who was captured while carrying out a mission in the Vietnam War.

Trump quipped in July 2015 that McCain was "not a war hero" and that he liked "people who weren't captured," prompting Schlapp to tweet that Trump had gone "too far with his comments."

"Not smart to attack a war hero," Schlapp wrote. "Enough w the insults. Learn how to play nice."

#Trump went too far with his comments on #SenatorJohnMccain. Not smart to attack a war hero. Enough w the insults. Learn how to play nice. — Mercedes Schlapp (@mercedesschlapp) July 18, 2015

Vladimir Putin

Trump said in a September 2015 debate that he would talk to and "get along" with Vladimir Putin, the Russian president.

That comment apparently irked Schlapp, who tweeted, "#DonaldTrump 'I will get along with Putin.'?????? What is he thinking? #CNNDebate."

#DonaldTrump "I will get along with Putin."?????? What is he thinking? #CNNDebate — Mercedes Schlapp (@mercedesschlapp) September 17, 2015

Suggestion Trump was more fit to be a Democratic candidate

The day after the first Republican primary debate, Schlapp fired off a tweet that appeared to question Trump's conservative bonafides.

"Maybe #DonaldTrump will change parties again so he can be on the Democrat debate stage," she wrote.

Maybe #DonaldTrump will change parties again so he can be on the Democrat debate stage — Mercedes Schlapp (@mercedesschlapp) August 7, 2015

Abortion rights

Schlapp seemed concerned that Trump was not adequately anti-abortion.

In July 2015, a month after Trump had launched his campaign, she tweeted, "Why #DonaldTrump surge won't last? in 1999, Trump stated he was prochoice."

In August 2015, Schlapp added, "@realDonaldTrump may not defund #plannedparenthood. it's not acceptable. no taxpayer $ for org that harvest baby parts. women deserve better."

Miscellaneous

Schlapp expressed disappointment in Trump for failing to pledge to endorse the Republican nominee regardless of who it was.

"Very disappointing #Trump answer that he will not make the pledge at this time," she wrote.

Very disappointing #Trump answer that he will not make the pledge at this time. — Mercedes Schlapp (@mercedesschlapp) August 7, 2015

In another tweet, Schlapp appeared to suggest Trump was not a thoughtful candidate.

"Is @CarlyFiorina the thoughtful version of #DonaldTrump?" she asked.

-- CNN's Andrew Kaczynski contributed reporting.