WASHINGTON — For five months of the Obama administration, the highest-ranking Mormon in the White House was an unpaid intern.

It was a staggering comedown for The Church of Jesus Christ of Latter-day Saints.

Dwight Eisenhower had church Elder Ezra Taft Benson in his Cabinet. Lyndon Johnson considered church President David O. McKay a close friend and spiritual adviser. Prominent Mormon George Romney was a member of Richard Nixon's cabinet. Ronald Reagan had two Mormons in his Cabinet and three who served on his personal White House staff. Brent Scowcroft was the national security adviser for Gerald Ford and George H.W. Bush. Mike Leavitt served in George W. Bush's Cabinet.

So when LDS historian Greg Prince looked back this week on his daughter's internship in the Obama White House, he thought it was an apt metaphor for a good part of the relationship between the LDS Church and President Barack Obama.

Obama's two terms as the 44th president of the United States end Friday with the inauguration of the 45th, President Donald Trump.

While Obama developed respect and an affinity for President Dieter F. Uchtdorf of the faith's First Presidency and found common ground on some immigration issues, the past eight years featured ideological collisions between the Obama administration and church leaders on issues related to religious liberty and same-sex marriage.

At times, the lack of a natural administration channel to the church left Sen. Orrin Hatch, R-Utah, the senior Mormon in Congress, as a conduit. While Hatch found the administration helpful on issues related to Mormon missionary visas, for example, he was himself equally at odds with the president and his staff on religious liberty and marriage, not to mention the political realities of his position as the Senate's senior Republican in a Democratic administration.

"I've had many private conversations with him (Obama) in his office," Hatch said. "Sometimes he wants more than I can give him."

After laughing, Hatch added, "Usually he wants more than I can give him."

No surprise

The gaps between Obama and the church and the collisions they experienced are not surprising.

"If you look at each administration on its own merits, particularly over the past 35 years," Prince said, "when the Republicans are in the White House, the Mormons prospered. When the Democrats were in the White House, the Mormons essentially were frozen out."

In the middle of it all, a Mormon named Mitt Romney squared off against Obama in the 2012 presidential election.

Still, from 2009 to today, both sides made efforts.

President Uchtdorf, second counselor in the First Presidency, attended Obama's historic first inauguration in January 2009 with Elder M. Russell Ballard of the Quorum of the Twelve Apostles.

Six months later, LDS Church President Thomas S. Monson traveled to the White House and presented Obama with his genealogy during the 14th meeting between a U.S. president and the church's president. Mormon Senate Majority Leader Harry Reid, D-Nevada, was part of the meeting, as was Elder Dallin H. Oaks of the Twelve.

"I’m grateful for the genealogical records that they brought with them," Obama said, "and am looking forward to reading through the materials with my daughters. It’s something our family will treasure for years to come."

In March 2010, Reid and Elder Oaks returned to the White House to present First Lady Michelle Obama with a comparable personal history. She had been the first Obama to meet church leaders, on a campaign stop in Salt Lake City in February 2008, when she talked about family values with Elder Ballard and Elder Quentin L. Cook of the Twelve.

Those meetings appeared warm and helpful, but the relationship cooled as the church's religious liberty concerns collided with Obama's views.

Freedom of worship?

Hatch and Reid provided Obama with innumerable opportunities to interact with Mormons. Hatch confirmed this week that Obama has not been hostile.

"We've been able to get President Obama and the Democrats in power to do a lot for the church in the past eight years," he said. "Some of their approaches and philosophies have been threatening to our beliefs, especially in religious liberty. I have had to push back."

But when Hatch has called the State Department for help with visa issues for Mormon missionaries or General Authorities, he wasn't turned away.

"I've been fortunate to have them take our calls," he said. "I felt good about that."

Still, Hatch said, "I'm not sure (President Obama) was as dedicated to religious liberty as I am."

In fact, Hatch said that the Religious Freedom Restoration Act he sponsored in 1993 was a bulwark against liberal attacks over the past decade.

"If we hadn't passed that bill then, there would have been some real intrusions on religious liberty with this administration. We could not enact that bill today."

By 2010, Obama was saying that his views on same-sex marriage, which he had initially opposed, were evolving. In February 2011, Elder Oaks expressed concern over a statement by Obama among a list of statements where linguistics seemed to narrow the protections of free exercise of religion. Obama had used the words "freedom of worship" instead of "free exercise of religion."

Though the LDS leader acknowledged that the president and his state department officials since had resumed using traditional references to the right to practice religious faith, he had additional concerns.

"Even more alarming are recent evidences of a narrowing definition of religious expression and an expanding definition of the so-called civil rights of 'dignity,' 'autonomy' and 'self-fulfillment' of persons offended by religious preaching," Elder Oaks said in a speech at Chapman University Law School. He then cited the president’s head of the Equal Employment Opportunity Commission, Chai Feldblum, who "recently framed the issue in terms of a 'sexual-orientation liberty' that is such a fundamental right that it should prevail over a competing 'religious-belief liberty.'"

Obama affirmed in March 2012 that he now supported same-sex marriage. In June 2015, the U.S. Supreme Court made same-sex marriage the law of the land. The church's position has remained clear. The faith's leaders say all people should be treated with kindness and respect and that Mormons should follow the law, but that doctrine limits marriage within the church to a man and a woman.

Relationship building

Meanwhile, President Obama and President Uchtdorf engaged in dialogue.

It began indirectly in April 2011. A White House official met President Uchtdorf and heard him speak at a BYU Management Society meeting in Washington. The official was so favorably impressed that he began to work within the White House to arrange a meeting between the two men.

In the meantime, in the spring of 2012, after it was clear Romney would be the Republican nominee to oppose a second Obama term, the administrations Office of Faith-based and Neighborhood partnerships invited a handful of Mormons to the White House. Obama's staff wanted to know what initiatives they could work on with Mormons. Fatherhood, the Mormons replied, grabbing an issue about which the president had discussed frequently at the time.

The meeting was pleasant and productive, but never led anywhere substantive, said Patrick Mason, the head of the Mormon Studies program at Claremont Graduate University.

"I don't see any strong hostility between the two as much as competing worldviews on matters they cared a lot about," Mason said of Obama and church leaders.

In fact, Obama appointed BYU law professor Larry Echohawk as his administration's Assistant Secretary of the Interior for Indian Affairs in May 2009. Echohawk resigned in April 2012 when Mormon leaders called him to a church leadership position as a General Authority Seventy.

President Uchtdorf's first meeting with Obama was in March 2013, when 14 religious leaders met in the Roosevelt Room, where the president asked them to support his effort to streamline the legal immigration process. President Uchtdorf emerged to say the president's outline for immigration reform matched Mormon values.

A year later, Obama invited President Uchtdorf to a White House prayer breakfast and a meeting of religious leaders in the Oval Office. Prince, the LDS historian, was at the breakfast. As Obama interacted with President Uchtdorf, "I saw deep affection between the two men that was reciprocal," Prince said.

When Obama visited Salt Lake City in April 2015, he spent a portion of his brief time here with Mormon leaders, President Uchtdorf among them.

"I don't think it's an overstatement to say President Uchtdorf dazzled (Obama and his staff)," Prince said. "He became the best embodiment of Mormonism as far as the Obama administration."

Culture change

Prince said he is convinced two things have hurt the LDS Church's relationship with the Obama administration. The first is a longer-term issue, caused when the Religious Right became a political force in the 1980s and began to demonize the Democratic Party at a time when Utah is among the reddest of states. Two, after Obama beat Romney in 2012, a study showed that Utah ranked fourth in the nation for producing the most racist tweets.

Those who make too much of the divide between the president and the church over gay marriage should do so cautiously, Mason said.

"I think we still don't appreciate how quickly the culture changed around this issue," he said. "I don't think there's any other rights issue in American history, and I'm not exaggerating here, where the culture changed so drastically so quickly."

Mason said the whole country changed its mind about gay rights and gay marriage in the course of a generation.

Final days

Church apostles attended Obama's second inauguration in 2013. He clearly had a good visit with church leaders in 2015 in Salt Lake City. And in the past couple of years, the faith's leaders have found occasion to praise statements made by Obama on religious liberty.

In 2015, Elder Oaks said he was "heartened by President Barack Obama's recently declared support for free speech on campus and for broader respect for religion in speech."

While this past October an LDS leader signed a letter from interfaith leaders to Obama asking him to renounce a U.S. Commission on Civil Rights report the group said stigmatized religious Americans, in December the church saluted Obama's 2014 declaration that religious freedom is the "critical foundation in our nation’s liberty" and admonished "every country to recognize religious freedom as both a universal right and a key to a stable, prosperous and peaceful future."

Mormon historian Matthew Bowman said understanding the disagreements require an understanding of broader developments that simple narratives about religious liberty miss.

"We're now in the process of negotiating what the First Amendment should mean in a more pluralistic society," he said.

"Obama is a serious thinker about these issues," added Bowman, author of "The Mormon People: The Making of an American Faith." "He is a liberal Protestant with roots in African-American Christianity, and thus approaches such questions with a consequent emphasis on social justice, ecumenism and tolerance deriving from those religious traditions. Other religious groups tend to emphasize different religious values, Mormons among them. So it's inevitable, I think, that there will be disagreements.

"That, though, doesn't mean Obama has been pro- or against 'religious freedom'; it means that American society is in the process of trying to work out what religious freedom means in a far more diverse religious society than that which existed 50 or 60 years ago."