 Ruiz Huidobro organized an expedition to recapture Buenos Aires, but just as he was ready to leave, captain Liniers arrived with fresh information about the local resistance that was being formed, and he was given command of the troops.Using the Montevideo troops and the local resistance, Liniers retook the city, putting an end to the first invasion of 1806.The next year saw the British come back in the second invasion, landing at Maldonado and then marching to Montevideo.