Washington (CNN) Mike Pence was chosen as Donald Trump's vice presidential nominee in part because of his ability to stay on message and maintain his relationships with fellow Republicans -- even under political pressure.

This week, those skills are being put to the test.

The Indiana governor's role as Trump's apologist-in-chief has come into focus in recent days as Trump has kept up his hostility toward a slain soldier's Muslim parents and Republican Party leaders on Capitol Hill.

Pence's mission: Clean up the intra-party mess Trump made by declaring to The Washington Post on Tuesday afternoon that he isn't endorsing House Speaker Paul Ryan or Arizona Sen. John McCain in their Republican primaries.

On the campaign trail, Pence is often splitting or sounding a different note than the real estate mogul. On Wednesday, Pence broke with Trump by endorsing Ryan -- a move he made with Trump's blessing.

"I talked to Donald Trump this morning about my support for Paul Ryan, our longtime friendship," Pence told Fox News in a phone interview. "He strongly encouraged me to endorse Paul Ryan in next Tuesday's primary."

I talked to @realDonaldTrump this morning about my support for Paul Ryan and our longtime friend ship.... pic.twitter.com/ihsKOvfnl7 — Mike Pence (@mike_pence) August 3, 2016

It followed Pence's meeting with McCain Tuesday night in Phoenix, ahead of Pence's town hall there. A McCain spokeswoman called the long-scheduled meeting "very friendly." Pence also lauded McCain in an interview with KNXV in Arizona, saying he has "provided the kind of leadership throughout his career that has stood up for our military, stood up for a strong America."

The Indiana governor ignored reporters' questions at a Denver airport Wednesday about whether he'll endorse McCain.

His public Ryan endorsement was seen as evidence of a split between Trump and Pence -- but several sources with knowledge of the relationship between the two men who share the Republican ticket said this is how they've operated all along, with Trump giving Pence wide latitude to say what he wants to say on Ryan, the parents of the slain Muslim American soldier that Trump engaged in a war of words with or any other thorny issue that Trump dives in on.

JUST WATCHED Pence defends Trump in Gold Star family feud Replay More Videos ... MUST WATCH Pence defends Trump in Gold Star family feud 01:12

The sources said there are open lines of communication between the two teams. Trump campaign chairman Paul Manafort got a heads up, for example, when Pence wanted to release a statement on Khizr Khan, father of the slain soldier -- and had no problem with Pence taking the stance that the Indiana governor wanted.

Trump and Pence, the sources said, had discussions early on in their relationship about how they would disagree on certain issues -- and that such disagreements would be fine. The campaign believes the American people will find it refreshing to have two candidates who say what they really feel, rather than going over every statement with a fine-toothed comb and making sure the candidates agree.

Underpinning the dynamic, the sources said, is that Trump's team feels that Pence is loyal and doesn't have his own agenda. So Trump aides are comfortable with Pence putting out statements that create distance from Trump. Whenever this has come up, the two of them have talked directly.

And Trump's guidance to Pence all along has been: "I want you to be who you are -- do your thing."

One example came a week ago, when Trump suggested -- sarcastically, he later said -- that Russia hack Hillary Clinton's emails to find 33,000 of them that were not turned over to the State Department.

Pence took a much different position, saying that "if it is Russia and they are interfering in our elections, I can assure you both parties and the United States government will ensure there are serious consequences."

Pence's statement was prepared before the Trump news conference in Doral, Florida, where he suggested that Russia hack Clinton's emails, a Pence aide said -- indicating the campaign was comfortable with a split before it had happened, as opposed to Pence attempting to clean up a mess Trump had made.

JUST WATCHED Trump campaign: Democrats' weakness established ISIS Replay More Videos ... MUST WATCH Trump campaign: Democrats' weakness established ISIS 01:10

The differences between Trump and Pence are clear at Pence's events.

When confronted with "lock her up!" chants about Clinton from the ticket's supporters, Pence typically doesn't respond.

Even in light-hearted moments, the difference in style is clear.

A baby cried out in the middle of a Pence campaign event Wednesday night after he said: "Hillary Clinton offers a third Obama term."

"My feelings exactly," Pence said, without missing a beat.

Meanwhile on Tuesday, Trump originally praised a baby after it cried out during his event in Virginia before saying: "Actually, I was only kidding, you can get the baby out of here?"

Pence has also shown that he is comfortable in tense moments at campaign events.

Challenged by an Air Force mother about Trump's attacks on the Khan family earlier this week, Pence sought to quiet a crowd that was booing the questioner.

"Well, I thank you for the question," he said. "It's all right, it's all right. Folks that's what freedom looks like and that's what freedom sounds like."

He has cast Trump as a non-politician who speaks from the heart, and can't help but be candid.

Meanwhile, the former congressman has tried to style himself as someone focused on the issues that bring the country together, even as Trump has criticized certain parts of the United States. Trump, for instance, said Harrisburg, Pennsylvania, "looks like a war zone" this week, laying the blame at the feet of President Barack Obama and Clinton.

"What unites us in these United States," Pence said Tuesday in Tucson, "is so much more powerful than what could ever divide us; our belief in freedom, our belief in individual responsibility, our belief in the boundless capacity of every individual to live out their dreams, and our belief since before this nation was founded that we are one nation under god, indivisible, with liberty and justice for all."

Trump's selection of Pence has brought some Republicans who'd been wary of the party's nominee on board.

Last week in Waukesha, Wisconsin, Gov. Scott Walker, was effusive in his praise for Pence, calling the pick "one of the best things that Donald Trump has done in this campaign."

"He had all sorts of opportunities -- what he did was put someone on the ballot to run with him that wasn't just a good political pick; he put someone on the ballot who could govern," Walker said.

Just how much credibility Pence can buy Trump -- and for how long -- is another question.

On Friday, Trump is due to return to Wisconsin for a visit to Green Bay. Walker and Ryan say they won't attend his event.