This is the second of two stories on the religious beliefs of the presidential nominees. Read about the faith of Donald Trump here.

After trading jokes with her Republican rival, Donald Trump, at the Al Smith dinner in New York, Clinton got serious, praising her Catholic hosts and Pope Francis' fights against climate change and inequality.

"I'm not Catholic. I'm a Methodist," Clinton said . "But one of the things that we share is the belief that in order to achieve salvation we need both faith and good works."

That's only half-true. Neither the United Methodist Church nor the Catholic Church teach that believers can work their way into heaven. Good deeds are important, both churches agree, but God's grace is freely given -- and the only means of salvation.

Clinton likely knows this. She's correctly stated the doctrine before, including at a church service in Washington last year.

Maybe her salvation stumble was the work of a sloppy speechwriter -- or perhaps, with apologies to Freud, it was a Pelagian slip. (Pelagius was a monk accused of teaching the heresy that humans could earn their own salvation.) Either way, Clinton's remark revealed a deep strain in her religious thought: There are no freeloaders in heaven.

"She didn't believe it was how high you jumped for joy in church," said the Rev. Ed Matthews, Clinton's pastor when she lived in Little Rock, Arkansas, in the 1990s, "but what you did when you came down."

The conventional Washington wisdom holds that Clinton is reluctant to talk about her faith, which is partly true. She doesn't often divulge details about her private piety, even while hinting that prayer and pastoral counseling have led her to consequential decisions, such as remaining with her husband, Bill, after the Monica Lewinsky scandal in 1998.

But during her three decades in politics, Clinton has been quite willing to talk about how her work has been inspired by her Methodist faith. She traces some of her political positions, particularly concerning children and the poor, directly to Christ's commandment to care for "the least of these."

Speaking to an assembly of Methodist women in 2014, Clinton cited the Gospel story of Jesus multiplying the loaves and fishes to feed a hungry crowd.

"He was teaching about the responsibility we all share, to step up and serve the community, especially to help those with the greatest need and the fewest resources," Clinton said.

Since then, the Democratic nominee has adopted a Methodist mantra as her unofficial campaign slogan: "Do all the good you can, for all the people you can, in all the ways you can, as long as you ever can." (The Clinton campaign did not respond to requests to interview the candidate.)

Despite these public testimonies, less than 50% of Americans say Clinton is "very" or even "somewhat" religious, according to the Pew Research Center.

A separate survey, by the Public Religion Research Institute , reveals stark religious and partisan divides in how Americans view the presidential nominees' faith. Nearly 80% of black Protestants, a traditional Democratic constituency, say Clinton has stronger religious beliefs than Trump; just 28% of white evangelicals, who lean heavily Republican, agree.

Evangelicals' antipathy toward Clinton runs long and deep, said Ed Stetzer, executive director of the Billy Graham Center for Evangelism at Wheaton College in Illinois.

Clinton's decades-long embrace of feminism and abortion rights clash with many conservative Christians' core beliefs. "Evangelicals see her as the personification of secular, progressive values, and that overshadows any of her self-identified religious practices."

But many conservative Methodists, even those who disagree with Clinton politically, say her faith appears to be authentic.

"Too often conservatives have been too dismissive of her religious beliefs, which are sincere," said Mark Tooley, a Methodist and president of the Institute on Religion and Democracy, a conservative think tank in Washington.

"She was shaped by the church and is still committed to it, and you can't understand her political framework without understanding her Methodist background."

The 'University of Life'

Clinton's father, Hugh Rodham, wasn't a churchgoer, but he was a praying man.

"I still remember my late father -- a gruff former Navy man -- on his knees praying by his bed every night," Clinton has said. "That made a big impression on me as a young girl, seeing him humble himself before God."

If Clinton's father provided the model for private prayer, her mother demonstrated how to put that piety into public action. Dorothy Rodham was active at First United Methodist Church in Park Ridge, Illinois, a large congregation in a Chicago suburb. She taught Sunday school and regularly raised money for charity, inspiring her daughter's interest in social justice

In 1961, when Clinton was a teenager, a youth pastor came blazing into Park Ridge behind the wheel of a red Chevy convertible. The Rev. Don Jones would inspire Clinton to see the world as her parish.

Fresh from seminary after a stint in the Navy, Jones gathered the sheltered Methodist youth of Park Ridge and gave them crash courses in the "University of Life." He read them poems by e.e. cummings, introduced them to Christian intellectuals such as Dietrich Bonhoeffer and Paul Tillich, and asked them to interpret modernist paintings such as Picasso's "Guernica."

"I think it's fair to say," Clinton said in 2009 while delivering a eulogy at Jones' funeral, "that next to my parents ... no adult had more influence on my life."

His challenges were more than intellectual. Jones took his Christian charges into inner-city Chicago churches, where they mingled with black and Latino teens, creating connections with people they might not otherwise have met. Jones encouraged his youth group to babysit for the children of Latino migrant workers and to visit the elderly in nursing homes.

Christians aren't supposed to sit quietly in church, hoping to get into heaven, Jones taught; they're supposed to build the kingdom of God on earth.

That idea lies deep in the DNA of the Methodist movement, historians say. The early Methodists in 17th-century England earned their name because they were methodical and disciplined about their duties toward God and to their fellow man. John Wesley, founder of Methodism, preached that Christians should practice not only personal holiness but also a " social holiness ."

"Methodists have always had a strong sense of social purpose," said David Hempton, dean of Harvard Divinity School and an expert in early Methodist history. They advocated against slavery, corruption, public drinking, animal abuse, popular sports and ostentatious displays of wealth. They visited prisoners and the sick, educated children and gave their extra earnings to charity.

Clinton has said that she spent a lot of time as a young person trying to "work out the balance between personal salvation and the social gospel."

In 1962, Jones took Clinton and her youth group to hear the Rev. Martin Luther King Jr. speak in Chicago, where the civil rights leader delivered his famous sermon "Remaining Awake Through a Great Revolution." King's challenge struck Clinton like St. Paul on his horse . She left the room that night a changed person, she would later recall.

"His words, the power of his example, affected me deeply and added to the lessons of my minister to face the world as it is, not as we might want it to be," Clinton told a group of Baptists in September, "but to commit ourselves to turning it into what it should be."

Bill Clinton credits King's speech with changing the trajectory of his wife's moral and political life. "It took my breath away when I realized 45 years ago that is really what motivates her," he said in Iowa this year.

At the time, though, Clinton remained a "Goldwater girl," a rock-ribbed Republican like her father. At Wellesley College, she headed the college's Young Republicans Club.

But a Methodist magazine, motive , flooded Clinton with progressive opinions -- rooted in liberal Christian theology -- on the Vietnam War and civil rights movement.

"I wonder if it's possible to be a mental conservative and a heart liberal," she wrote in a letter to Jones, who'd become a lifelong mentor and confidant. By her senior year, Clinton appeared to have completed her political conversion to liberalism, writing her senior thesis on Saul Alinsky, the leftist community organizer.

After college, Clinton says her Christian faith inspired her decision to do public service, rather than apply to white-shoe law firms. At the Children's Defense Fund, she says, she went undercover to expose systemic racism in the deep South and the plight of children with disabilities in New England.

Around the same time, she met Bill Clinton at Yale Law School, and eventually followed him to Arkansas, where they married in 1975. Several years later, while raising their daughter, Chelsea, Hillary Clinton joined First United Methodist Church in Little Rock.

While Bill attended a Baptist church down the road, Hillary became an active and "vital part" of the Methodist congregation, the local bishop later recalled. She volunteered to be the church's chancellor and taught adult Sunday school on the lawn of the Governor's Mansion.

The Rev. Ed Matthews, former pastor of First United Methodist Church of Little Rock, recalls one of Clinton's lessons keenly. It was about forgiveness, and how it is not a human quality but rather a gift from God.

When Clinton was first lady and facing her own crisis, Matthews said he went to the White House and reminded her of that lesson.

The lion's den

Soon after the Clintons arrived in Washington, they had dinner at the White House with a few pastors and their families, recalls the Rev. Tony Campolo. Hillary Clinton told the gathering that she reads Scripture daily, so the evangelical pastor asked what passages, in particular, interested her.

"She said, the 'Book of Daniel,' which seemed strange to me," Campolo recalled recently. He asked her why. "She said because the Book of Daniel describes with care how political leaders handle situations under great pressure."

In the Old Testament, the Book of Daniel is about a Jew exiled to Babylon, where he is tossed into the lion's den after his quick political ascent inspires jealousy. If the modern-day parallels aren't immediately obvious to others, they were evidently clear enough to the fresh-from-Arkansas Clintons.

Clinton read more than Scripture while in the White House, according to friends and colleagues. She continued to subscribe to motive magazine, which is now out of print, as well as Christianity Today, the flagship magazine for evangelicals. She said she kept a copy of the Methodist "Book of Resolutions," the church's policy statements, in her private quarters of the White House, and regularly read books by Christian authors. She occasionally carried a small book filled with spiritual quotations and another of the Bible's Book of Psalms.

"She has always loved the Psalms," said Matthews, the Arkansas pastor. "I think she relates to their search for meaning, and how the psalmist can change moods, from lamenting how evil the world is, and how everyone is mistreating us, to showing gratitude to God for the beauty of the world."

In Washington, the Clintons found a new church home on a snowy Sunday in January 1993. The family was feeling "stir crazy," Clinton recalls, so they trudged several blocks through the blizzard to Foundry United Methodist Church, where they surprised a pastor who had almost canceled services that morning.

The Rev. J. Philip Wogaman, Foundry's former pastor, recalls the Clintons attending his church regularly for the next eight years, some 100 or so Sunday services in all. They sat three rows back on the right center aisle, he said, directly in his line of sight from the pulpit.

Wogaman, a dignified man and Methodist scholar, said he tried not to preach politics overtly, though he thought carefully about the messages his sermons would send to the first family. He recalls only one overt political statement he made from the pulpit, asking Bill Clinton to carry the congregation's good wishes to the family of assassinated Israeli Prime Minister Yitzhak Rabin in 1995.

Chelsea became a part of Foundry's youth group, as her mother had in Park Ridge, and Wogaman recalls the Clintons attending parents' meetings and helping to plan for mission trips to Appalachia. When a member of the congregation fell ill, the Clintons would call the hospital to check up on them, the pastor recalled.

The first family walks outside Foundry United Methodist Church in Washington.

At a service marking Foundry's 200th anniversary last year, Hillary Clinton said the church was a place where "we were, not 'the First Family' -- we were just our family."

"This community -- because indeed that's what it is -- was a place where we could worship, study, contemplate, be of service, get some good pastoral advice, and step outside all the commotion of life in the White House and Washington. That was very, very precious to us."

But as the pressures -- and the scandals -- mounted, the first lady also looked elsewhere for spiritual sustenance.

Close friends say she keeps her own counsel. She is far more comfortable assuaging a friend's grief or regret than she is asking others for help. But in 1994, after her high-profile health-care reforms foundered and scandal swirled around the White House, the first family decided they needed help from outside Washington. They invited a number of New Age gurus and motivational speakers to Camp David in Maryland. One woman, Jean Houston, particularly intrigued Clinton.

Houston describes herself as a "scholar, philosopher and researcher in Human Capacities." One of those capacities, apparently, was the ability to converse with the spirit of Eleanor Roosevelt. In the Solarium of the White House, according to Washington journalist Bob Woodward , Houston encouraged Clinton to have brief "conversations" with Roosevelt and Gandhi, two revered figures for the first lady. Houston then asked Clinton to address Jesus, according to Woodward's account. That was too personal, Clinton said.

Clinton was annoyed when the sessions -- media sensationalists called them "séances -- were revealed. Her friends and former colleagues say the incident was overblown; it was only an "imaginative exercise."

"No doubt she admired Eleanor Roosevelt's courage and commitments, but to say that Hillary was having séances or communing with her is just crazy," said Melanne Verveer, Clinton's former chief of staff as first lady.

The media reaction was reminiscent, Verveer said, of the brutal criticism of Clinton's "Politics of Meaning" speech in 1993. In the somewhat rambling address, Clinton did what she so rarely does in public: let her guard down and show her true feelings.

Economic prosperity and political freedom aren't enough, Clinton said in the now-infamous speech. She encouraged Americans to dig deeper, to find the "core level meaning in our individual lives," to awaken from their "sleeping sickness of the soul."

The press tore her apart. "Saint Hillary," The New York Times mocked . "Psychobabble," another newspaper said.

Lissa Muscatine, Clinton's friend and former speechwriter, said the first lady felt blindsided and misunderstood. Her family had just taken Hugh Rodham, Clinton's father, off life support, a moment that stirred big questions in Clinton.

"She was trying to be reflective and thoughtful in a personal way, and she got completely ridiculed. It was painful because she was really trying to say something. Her father was dying; if people are not allowed to be introspective in those moments, then we have no empathy whatsoever."

Several months later, at a National Prayer Luncheon , Clinton said she was somewhat afraid to address religion again.

"The last time I spoke in public about spirituality, around the time of my father's death, I was astonished to realize that there were many people for whom spirituality should be confined to events like this, and not brought out into the public arena."

But whatever embarrassment Clinton felt, it would hardly compare with the public humiliation she would soon endure.

Forgiveness

At a White House prayer breakfast in 1998, President Bill Clinton apologized to the nation and to his family for conducting an affair with an intern, Monica Lewinsky. Couching his confession in Christian terms, the president said, "I don't think there's a fancy way to say that I have sinned."

Hillary Clinton sat stoically through her husband's speech, recalled Matthews, the Arkansas pastor, who was sitting a few feet away. When the speech ended, he knelt beside her.

"Are you all right, Hillary?" he asked.

"I don't know what I'm going to do," Clinton whispered to him, Matthews said.

"Do you remember what you taught me about forgiveness and grace?" the pastor asked, reminding Clinton of her Sunday school lesson from years ago.

Matthews says he doesn't even know if Clinton heard his question, she seemed so distraught and distracted. In her memoir "Living History," Clinton calls the Lewinsky scandal "the most devastating, shocking and hurtful experience of my life."

"I would have to go deep inside myself and my faith to discover any remaining belief in our marriage," Clinton writes, "to find some path of understanding."

During the scandal, three ministers, including Foundry's Wogaman and Campolo, the evangelical pastor, very publicly ministered to Bill Clinton.

But Hillary took a more private tact.

"Where some people might go to a shrink, she goes to a minister," said a friend and former staffer of Clinton's.

Clinton turned for counsel, as she often did, to her former youth pastor, Don Jones.

Just as he had during the Park Ridge days, Jones pointed Clinton to classic liberal Christian theology, including a sermon by Paul Tillich that they had read together decades earlier.

In "You Are Accepted," Clinton writes, Tillich teaches that "sin and grace exist in life in constant interplay; neither is possible without the other." The mystery -- and paradox -- of grace is that you cannot find it on your own; it finds you, often when you are most pained and restless.

"Grace happens," Clinton wrote.

Another spiritual classic offered lessons on forgiveness.

Clinton says she first read "The Return of the Prodigal Son" by Henri Nouwen, a Dutch Catholic priest, in 1994. Separately, two friends gave it to her, she writes in "Living History." The book became a "lifeline," she would later say.

Nouwen, a well-known spiritual writer, analyzes Jesus' story about the prodigal son from several perspectives: the father who forgives his wayward son, the son who returns home after squandering his family fortune, and the dutiful other son who had remained home.

Clinton has said the book's emphasis on the "daily discipline of gratitude" struck her with the force of epiphany. Even amid Washington's craziness and pitched partisan battles, she had much to be grateful for, said the former first lady.

Nouwen was also eloquent on the theme of forgiveness:

"Do I want to be not just the one who is being forgiven, but also the one who forgives; not just the one who is being welcomed home, but also the one who welcomes home ...?"

Clinton has said she might not have made it through the Lewinsky scandal without her faith; Matthews said that without her faith she likely would not have forgiven her husband.

"People say that it was because of money or power or political prestige, and maybe that was a part of it," the pastor said. "But it's her faith that makes her tick."

Devotions

Clinton is still a member of First United Methodist Church in Little Rock, Matthews says, but hasn't been back in years. Though she sometimes attends services at a Methodist church near her home in Chappaqua, New York, her duties as secretary of state and now the Democratic presidential nomination have kept her on the road, and away from regular Sunday worship.

But the Rev. Bill Shillady, a Methodist minister in New York, said he has found a way to pastor to the peripatetic Clinton.

Shillady met Clinton at a memorial for 9/11 victims in New York in 2002, when she was a senator. He invited her to his former church in Manhattan, and over time the families became close, sharing Easter breakfasts and meals at Christmastime. Shillady conducted Chelsea's wedding and a memorial service for Dorothy Rodham, Clinton's mother.

Around Easter in 2015, Shillady offered to send Clinton daily email devotions, which he wakes early each morning to compose. The devotions, which arrive in Clinton's inbox by 5 a.m., include a snippet of Scripture, a brief commentary on the passage and a prayer.

In recent months, Shillady has enlisted a team, including a group of young women pastors, to help write the devotions. (Burns Strider, Clinton's friend and faith adviser to her 2008 presidential campaign, also emails spiritual thoughts to the candidate.)

Clinton has said she appreciates the efforts, especially during the pressure cooker of a presidential campaign. "It just gets me grounded," she told a town hall in February

Occasionally, Shillady says, Clinton will respond to the devotions. She particularly liked the introduction to "Lady Wisdom," a figure from the poetry in the Old Testament.

In the Book of Proverbs, Chapter 8, wisdom is personified as a woman who raises her voice at the crossroads and before the gates to the city. In Eugene Peterson's colloquial translation of the Bible , Lady Wisdom stands at the busiest intersections, the "corner of First and Main."

"So, my sister, use your wisdom that God has given you, to help others to know of God's grace, truth and light," Shillady wrote, "For if anyone is at the corner of First and Main, it is you."

Loving thy enemies

Throughout her time in Washington, Clinton has surprised conservatives and her liberal allies by crossing the political aisle to participate in bipartisan prayer groups.

As first lady, Clinton says, she became close to several members of The Fellowship, a secretive Christian network of Washington power brokers. While in Congress, she shocked some Republicans by joining the Senate Prayer Breakfast.

On matters of Christian doctrine, Clinton shares core beliefs with conservatives. She has said she believes in the Holy Trinity , that Jesus' death atoned for human sins and that Christ's resurrection was a historical event . She prays regularly and is well-versed in Scripture, citing biblical passages accurately and with ease.

And yet, many conservative Christians refuse to recognize Clinton as a fellow believer. Ben Carson has connected Clinton to Lucifer , and a new documentary asks whether she is " an illuminati or the anti-Christ.

Kristin Kobes Du Mez, a historian at Calvin College in Michigan, said she was drawn to study Clinton's faith in part to understand why conservative Christians so vehemently deny it.

"Among conservative Christians -- those who most care about bringing their faith to bear on politics -- there's such a long history of if not demonizing Hillary Clinton, then at the very least setting her against everything they hold dear."

From the moment Clinton stepped on the political stage, she seemed to represent a rejection of conservative Christian values. She dismissed women who "stay home and bake cookies," insulting Christians who hold to "biblical" views of submissive women. She was shaped by a church that sees government as a partner -- sometimes to be criticized, but rarely feared as a threat to religious freedom. She participated in the anti-war movement and has affirmed liberal orthodoxies on abortion and other social issues.

Last year, she said that "deep-seated" religious beliefs on abortion "have to be changed," a pledge that angered Christians who consider abortion the killing of innocent lives.

Meanwhile, many conservative Christians have created their own subculture, said Du Mez, publishing anti-Clinton books, hosting anti-Clinton radio shows, writing anti-Clinton articles and consuming anti-Clinton TV reports.

"They aren't often confronted with different ways to be Christian in America today. Thus, they assume Clinton must be lying about her faith. Or pandering," the historian said.

Of course, Clinton is no mere figurehead. She has been a protagonist in some of the most protracted political scandals in recent history, from her husband's sexual infidelities to her own dissembling about the use of a private email server while secretary of state. According to surveys, many Americans do not think Clinton is trustworthy.

Still, as Clinton has acknowledged, politics is a "rough and tumble" business, and it's hard to imagine any politician who hasn't found foes along the way. But at a Baptist convention in Kansas City, Missouri , Clinton said that she has been trying to follow Christ's commandment to love her enemies.

It's a lesson she remembers well from teaching Sunday school in Arkansas, she said, but some days it's "really hard" to put the lesson into practice.

It is just as hard, it seems, for Clinton's enemies to love her.