Theresa May was warned that her three Brexit priorities for Ireland were incompatible back in 2016, the UK's former ambassador to the EU has said.
Sir Ivan Rogers also said he discussed the same dilemma with Boris Johnson, the frontrunner to become the next prime minister.
The former diplomat told the Foreign Affairs Committee on Tuesday that Mrs May's speech setting out her Brexit red lines prompted him to think they would cause a stir in Brussels.
And that he and then cabinet secretary Lord Jeremy Heywood had no sight of the address before it was delivered.
Sir Ivan said that in 2016 he delivered "one of the most unpopular things" he had told to the PM.
He said it was that "you have made three commitments in good faith to different audiences, but they are not really compatible with each other".
"You have said to the Irish ... under no circumstances will a hard border be erected across the island of Ireland.
"You have said to the Democratic Unionist community under no circumstances will there be divergence from the rest of Great Britain.
"And you have said to the right of your own party that you are heading out of the customs union.
"You can't do all three. You have got to choose two of the three."
The backstop agreement - a last-resort mechanism to prevent a hard border in the island of Ireland if no post-Brexit deal is negotiated - proved to be a major sticking point and helped lead to Mrs May's demise as PM.
Sir Ivan also said he issued Tory leadership contender Mr Johnson with the same warning when he was foreign secretary.
In further evidence, Sir Ivan discussed his shock at Mrs May's red lines.
She told the Conservative Party conference in 2016 that any deal would have to include control of the UK's borders, exiting the EU's single market and not staying in the customs union.
Sir Ivan, who quit as the UK permanent representative in 2017 after clashing with ministers over Brexit, said he "didn't get any sight of it in advance", despite seeing previous party leaders' addresses.
"I didn't see the speech. I, of course, thought the moment I did see it 'blimey that's going to elicit quite a reaction in Brussels'," he said.
"I did talk to Jeremy Heywood and say 'did you see the speech, it's a bit puzzling that we suddenly get landed with this and red lines which are really going to take people by surprise in Brussels' and he said he hadn't seen it."