Article 43 Vienna Convention on Diplomatic Relations
The function of a diplomatic agent comes to an end, inter alia:
(a) On notification by the sending State to the receiving State that the function of the diplomatic agent has come to an end;
(b) On notification by the receiving State to the sending State that, in accordance with paragraph 2 of article 9, it refuses to recognize the diplomatic agent as a member of the mission.
See also: Article 42 Vienna Convention on Diplomatic Relations