Democratic presidential candidate Hillary Clinton got a piece of advice from her former pastor when she marked the bicentennial of her Methodist church: Be nice to the press.

Clinton said Sunday that her family's time at Foundry United Methodist Church in Washington during husband Bill Clinton's presidency allowed them to worship, contemplate life and step outside the commotion of life in the White House.

"Here we were not the first family, we were just our family," Clinton said, describing the first time they attended services following a major snow storm. "And we relished and cherished that time."

The Democratic presidential candidate said before the start of the church's celebration, her former pastor, J. Philip Wogaman, reminded her that the scripture reading was from Romans 12. "If you're going to read and listen to Romans 12," Clinton recalled him telling her, "you've got to be nicer to the press."

"I will certainly take that to heart," Clinton said to laughter. Clinton has had strained relations with the media covering her in the past, and part of the Bible passage says, "Bless those who persecute you. Don't curse them; pray that God will bless them."

A lifelong Methodist, Clinton was joined by her husband who sat with her near the front of the church, and their daughter, Chelsea Clinton, who spoke briefly about her time as a member of the church's youth ministry.

The service, held about a mile from the White House, came as Clinton's campaign has struggled with questions about her use of a private email server as secretary of state and an upstart challenge from Vermont Sen. Bernie Sanders.

During her remarks, Hillary Clinton steered clear of politics, recalling the role her Methodist church played in her upbringing in suburban Chicago. She reflected on attending a speech by Dr. Martin Luther King Jr. in Chicago with her youth pastor and friends, and said her late mother, Dorothy, taught Sunday school and encouraged her to live by the teachings of John Wesley, one of the co-founders of the church.

Clinton said scripture teaches the need for people to discover and use their gifts from God and live up to their full potential. She said it was among the nation's ongoing challenges. "There are still hard truths to face about race, gender and sexual orientation in America," she said.