The Democratic presidential candidate Pete Buttigieg, right, and his husband, Chasten, with former President Jimmy Carter on Sunday at Carter's Sunday school class in Plains, Georgia. Paul Newberry/AP

Mayor Pete Buttigieg and his husband, Chasten, on Sunday went to former President Jimmy Carter's Sunday-school class.

The South Bend, Indiana, mayor said he was "humbled" to meet with Carter at his church in Plains, Georgia.

Buttigieg had lunch with Carter after the class.

In a tweet, Buttigieg described Carter as a "true public servant" and said the US was "blessed for his continuing leadership."

Mayor Pete Buttigieg and his husband, Chasten, visited Jimmy Carter's Sunday-school class in Plains, Georgia, on Sunday and then had lunch with the former president.

The South Bend, Indiana, mayor said he was "humbled" to meet with Carter, who has hosted other 2020 Democratic candidates such as Sens. Cory Booker and Amy Klobuchar at his Sunday-school class.

Carter invited Buttigieg to stand and read from the Bible to those attending the class at Maranatha Baptist Church in southern Georgia, the Associated Press reported.

In an apparently jocular reference to Buttigieg, the report said, Carter at one point elicited laughter from the crowd when he said, "You know him?"

Read more: Democratic 2020 candidate Pete Buttigieg tells Mike Pence in fiery speech that his marriage to his husband moved him 'closer to God'

Buttigieg's visit was unannounced, and some questioned who he was when he entered the room. In response, one attendee reportedly said, "Mayor Pete, the guy running for president."

"I was humbled to meet with President Carter in Plains, Georgia today," Buttigieg said in a tweet after their meeting. "He is a true public servant and America is blessed for his continuing leadership."

Buttigieg's husband, Chasten, in a separate tweet said the two had "a lovely visit" to Plains.

Read more: Pete Buttigieg shrugged off antigay protesters yelling at him about Sodom and Gomorrah: 'The condition of my soul is in the hands of God, but the Iowa caucuses are up to you'

Buttigieg in the past several months has gone from being relatively unknown to among the most serious contenders for the 2020 Democratic nomination for president, garnering nonstop media attention as he's climbed up the polls.

The South Bend mayor, who is a gay Episcopalian Christian, has often discussed his faith along the campaign trail - at one pointing taking a jab at Vice President Mike Pence's anti-LGBTQ stances and rhetoric.

Buttigieg has also faced antigay heckling as he's campaigned, but he has shrugged it off.

NOW WATCH: Popular Videos from Insider Inc.