Rwanda's intelligence chief Karenzi Karake has been granted bailof £1m ($1.6m) by a court in London.
Karenzi Karake was detained at London's Heathrow Airport on Saturday, in response to a European Arrest Warrant.
Rwanda's President Paul Kagame had earlier launched a scathing verbal attack on the UK government over Gen Karake's arrest.
Mr Kagame said it was a continuation of "colonialism" and accused the British of "arrogance and contempt".
Gen Karake is accused by Spain of ordering massacres in the wake of the 1994 Rwanda genocide.
He will be freed once the £1m is paid and other bail conditions are met.
After the hearing, Rwanda's High Commissioner to Britain, Williams Nkurunziza, said: "I'm very happy but I would have been happier if he would have been allowed to return.
"This is the best it gets with this legal system."
Gen Karake will have to report to police daily and live either at the high commissioner's home or in a house rented by the Rwandan embassy.
President Kagame said that the British authorities "must have mistaken [Gen Karake] for an illegal immigrant. The way they treat illegal immigrants is the way they treat all of us"
He added that the British had been patronising, "wagging a finger at the African and telling him this is where you belong. We are no longer the African that belongs there".
Gen Karake, 54, was greeted by cheers and clapping by supporters as he arrived in the courtroom.
A full hearing to discuss his extradition to Spain will take place on 29 and 30 October.
Gen Karake, whose defence team includes Cherie Booth, former British prime minister Tony Blair's wife, said in court that he would fight his extradition.
In Rwanda, there have been protests outside the British High Commission in the capital, Kigali.
Protesters have threatened to remain until Gen Karake is released.
William Gelling, the UK's High Commissioner to Rwanda, addressed the crowd briefly on Wednesday.
"All I can say is that this was a legal decision as you understand, on behalf of the Spanish legal authorities.
"The UK is a very close partner with Rwanda,'' he said, as quoted by the AP news agency.
Spanish investigative judge Andreu Merelles indicted Gen Karake in 2008 for alleged war crimes, along with 39 other current or former high-ranking Rwandan military officials.
He is accused of killing ethnic Hutu civilians in both Rwanda and Democratic Republic of Congo, after the Rwandan Patriotic Front (RPF) came to power in 1994.
The Tutsi-dominated RPF helped end the genocide, in which some 800,000 Tutsis and moderate Hutus were slaughtered by Hutu extremists.
He is also accused of ordering the killing in 1997 of three Spanish nationals working for Medicos del Mundo.