An agreement has been signed in French Polynesia allowing the Chinese consulate to stay on in its current premises in Tahiti until the end of August.
A dispute over rent and maintenance prompted the owners, Huguette Ly and her daughter Eva Bitton, to give Beijing's diplomats notice last July.
They were asked to leave the house in Punaauia by the end of February.
However, they stayed while refusing the owners access to the property, writing that "once rented, the house has become territory of the People's Republic of China".
The residence had been rented since 2007 as the consul's home but was later converted to the consulate's office.
After weeks of discussions between the two sides' lawyers, a protocol was signed at the beginning of this week by the consul, Shen Zhiliang, and Mrs Bitton to pave the way for an orderly exit from Residence Taina.
The new deal recognised that the lease ended in February and said that as of this day, China's consulate was authorised to occupy the building until the end of August.
It stated that the consul would pay a monthly fee backdated from the beginning of March.
The protocol also called for an expert to be hired to identify remedial work so that the building in Punaauia could be returned to its original state, including the dismantling of the satellite dish on the roof.
In the document both sides acknowledged that the lease expired at the end of February and they agreed that a new occupation period started on signing.
It also says should the consulate fail to move out by the end of August, it would have to pay an additional $US300 a day until the house was vacated.
The agreement followed a social media campaign by Mrs Bitton who also launched an online petition in a bid to regain control of the house.
In it, she accused the diplomats of occupying her house without title or right.
That was being challenged by the Chinese diplomat's lawyer, Marie Eftimie-Spitz.
The lawyer said there was a verbal agreement in late February by the owner to extend the diplomats' stay until the end of August, subject to some conditions.
Under French law, such a verbal agreement is equivalent to a formal contract, Mrs Eftimie-Spitz said.
Therefore the rental arrangement remained legal even after the expiry of the lease at the end of February, she said.
In addition, the lawyer argued that because the rent was being paid retroactively from the beginning of March there could be no suggestion that in the intervening weeks the property was used illegally.
Mrs Bitton expressed surprise to hear last month that she had allegedly entered into an agreement, but her lawyer assured her that was not right.
While she was obliged to attend a meeting to discuss an amended protocol she did not approve it nor sign it, Mrs Bitton said.
She wondered what the point was of signing a protocol if sitting down for a talk could be regarded as legal consent for the occupation of a property.
After receiving advice from the French High Commissioner in Papeete and in the confidence that the consul would honour the commitment, Mrs Bitton said she signed the protocol in the hope of being able to get her mother's house back.