Bernie Sanders boasted on Friday that he was invited to a conference at the Vatican, but an official there said he forgot to mention who extended the invitation — himself.

Margaret Archer, president of the Pontifical Academy of Social Sciences, said it was clear Sanders wanted to exploit the group’s gathering for political purposes.

“Sanders made the first move, for the obvious reasons,” she told Bloomberg News.

“I think in a sense he may be going for the Catholic vote, but this is not the Catholic vote and he should remember that and act accordingly — not that he will.”

Sanders, whose foreign-policy experience has been under attack by Hillary Clinton, said he was “very excited” about being invited to the meeting — which will also be attended by a pair of US-hating Latin American presidents.

And at first, he didn’t correct reporters who suggested he would be meeting with the pope.

But Vatican officials said no visit was planned, which he later acknowledged.

Archer said that while she “quite liked” Sanders’ policies, his failure to contact her first was a breach of protocol.

“The president of the academy organizing this event has not been contacted, with monumental discourtesy,” she said of herself.

Sanders, she added, made the first move several days ago.

“His use of it is clearly a pretext,” Archer said. “There are just 20 academics and there will be nothing of policy relevance.”

Clinton spokesman Brian Fallon noted the dust-up on Twitter, writing, “Holy smokes” along with a link to a story on the visit.

The conference will take place in a patrician villa in Vatican City on April 15 and 16 — days before the April 19 primary in New York.

Michael Shank of the Sanders campaign denied there was a rift, and provided The Post with a copy of an invitation dated March 30 from Monsignor Marcelo Sanchez Sorondo, the chancellor of the academy — who called Archer a liar.

“This is not true and she knows it. I invited him with her consensus,” said Sorondo, who is Archer’s boss.

Additional reporting by Elizabeth Rosner