Uganda says the Democratic Republic of Congo has agreed to let its troops continue to pursue Lord's Resistance Army rebels in northern DR Congo.
Uganda's Information Minister told the BBC that presidents Yoweri Museveni and Joseph Kabila had agreed the deal on Wednesday at the border town of Kasese.
Congo's President Kabila was reportedly under pressure from some of his supporters to end the Ugandan presence.
Ugandan troops were due to leave DR Congo at the end of February.
The operation against the LRA - known as Lightning Thunder - was launched by Uganda, DR Congo and Sudan in mid-December.
In the wake of the offensive, the rebels have attacked villages in DR Congo and South Sudan and are estimated to have massacred more than 900 people.
On Tuesday, two people - a man and a woman - were killed on the outskirts of the Sudanese town of Yei.
And on Wednesday evening, the LRA stormed the home of a chief during a funeral, killing six people and abducting six others.
BBC Africa analyst Martin Plaut says some compromise has been achieved between Uganda and DR Congo.
Ugandan forces based in South Sudan will be allowed to fly in by helicopter on a daily basis to try to hunt down the elusive rebel leader, Joseph Kony.
Three Ugandan battalions - 3,600 troops - are based in Sudan and around 300 soldiers fly into DR Congo at a time to carry on their mission.
On Wednesday, Uganda's military paraded an LRA commander captured during fighting in the remote forests of Garamba National Park.
Thomas Kwoyelo is believed to be the LRA's fourth-in-command.
But LRA leader Mr Kony remains as elusive as he was when the conflict began more than two decades ago.
His long and brutal rebellion against the Ugandan government has left tens of thousands of people dead, driven some two million people from their homes and destabilised a swathe of central Africa.
Last year, the LRA leader refused to sign a final peace deal thrashed out at two years of talks in neighbouring South Sudan - prompting the Ugandan military to lead the latest offensive.
Mr Kony insists that the International Criminal Court withdraw arrest warrants against him and some of his closest allies, before he will sign the deal.