Histories of the Hanged: Britain's Dirty War in Kenya and the End of Empire by David Anderson (3250pp, Weidenfeld & Nicholson, £20)Britain's Gulag: The Brutal End of Empire in Kenya by Caroline Elkins (352pp, Jonathan Cape, £20)

Gordon Brown, on his recent trip to Africa shortly after he left Kenya, announced that Britain should stop apologising for colonialism. We should be proud of our colonial history in Africa, he said, and praised "British values" such as liberty, tolerance and civic virtue.

It is both shocking and understandable that Brown should have made his comments having just come from Kenya. Shocking because Britain used methods of repression in colonial Kenya that were reminiscent of Nazi Germany or the Soviet Union. Understandable because the post-colonial policies of both Britain and Kenya were to cover up the past, walk away from it. Although it happened in his own lifetime, Brown is simply confirming that collective amnesia.

Two new books, Histories of the Hanged, by David Anderson, and Britain's Gulag, by Caroline Elkin, administer a much-needed jolt to our memories, reminding us in unsparing detail how for seven years in the 1950s Britain pursued a murderous little war in Kenya - mass murderous at times - against a rebellion called Mau Mau. Abandoning moral values, its troops killed and tortured civilians with impunity.

One officer quoted by Anderson gives a taste of the impunity - and the hatred. Interviewing three enemy suspects he says: "One of them, a tall coal-black bastard, kept grinning at me, real insolent. I slapped him hard, but he kept on grinning at me, so I kicked him in the balls as hard as I could ... When he finally got up on his feet he grinned at me again and I snapped. I really did. I stuck my revolver right in his grinning mouth ... And I pulled the trigger. His brains went all over the side of the police station. The other two (suspects) were standing there looking blank ... so I shot them both ... when the sub-inspector drove up, I told him the (suspects) tried to escape. He didn't believe me but all he said was 'bury them and see the wall is cleaned up'."

No British official, military or civilian, has ever been investigated or prosecuted for what happened in the suppression of Mau Mau. Iain Macleod, the colonial secretary, declared as it ended that a veil be drawn over the whole business. After a spate of memoirs in the 50s, it has been barely lifted. These two books tear substantial holes in that veil and reveal the horrors it covers. At least we can now see some of the detail and judge where responsibility lay.

Mau Mau - the origin of the name is still obscure - began in the early 50s among the Kikuyu of the Kenyan highlands who had been forced off their lands by white, mainly British, settlers. Although the British government had declared that Kenya was not "white man's country" and the interests of the native population of Kenya were paramount, the Kikuyu were gradually stripped of their land throughout the first half of the 20th century. As in southern Africa, the local farmers were forced to become labourers on settler farms. The settlers combined to keep wages low.

British officials, bullied by the settlers, ignored African leaders making moderate political demands for African advancement and representation. Militants were locked up. Unsurprisingly, suppressed political associations turned into secret societies, the cells of a violent rebellion. On May 15 1952, the mutilated bodies of a village headman and a police informer were found floating in a river. Mau Mau had begun.

Over the next seven years Mau Mau killed only 32 white settlers but tens of thousands of Africans who served or profited from the British administration. Mau Mau's horrific murders and mutilations - mostly against their own Kikuyu people - convinced British administrators they were fighting a primeval rejection of civilisation, a reaction against modernity, which had to be crushed at all costs. Elspeth Huxley called it "a yell from the swamp".

The British reacted with maximum violence. Unaccustomed to listening to Africans, even "moderate" ones, they could not or would not see political, social or economic causes behind the rebellion. They turned their forces, including heavy bombers, on the forest fighters. The british system was punctilious and methodical: tens of thousands were rounded up and imprisoned - 71,046 in December 1954.

But the British also deployed an even more fatal if effective method, the one they had used against Afrikaner civilians in the Boer war, the concentration camp. Both Anderson and Elkins draw convincing parallels with Nazi concentration camps and Stalin's gulags. More than 1m people were crammed into heavily guarded camps where starvation and disease killed thousands.

On the outside, the army used the same tactics that the Sudanese government has been using against the rebels in Darfur: they armed the local enemies of the rebellion and encouraged them to kill, rape and loot at will. When accounts of British atrocities leaked out, officials in Nairobi and London lied to deny them. When a few brave souls spoke out or even resigned, they were persuaded to keep quiet. When at last some of the truth came out the game was up. Even the young Enoch Powell, from the far right of the Tory party, declared that if Britain behaved like this it did not deserve an empire.

The British won the war, but, already well on the way to dismantling the empire, the Conservative government in London was forced to bring forward the date of Kenyan independence.

The white settlers lost political privilege and Britain was forced to release the nationalist leader, Jomo Kenyatta, from jail. He had lost the political initiative to Mau Mau in the early 50s, but in a trial that was fixed he had been convicted of being its leader and imprisoned. The British frantically tried to undermine his credibility and prop up alternative leaders, but his popularity remained undimmed and they were forced to accept him as Kenya's first president. Known as Muigwathania - the reconciler - he chose to befriend the British and save their interests in Kenya. He called Mau Mau "a disease which has been eradicated and must never be remembered".

Since then there have been many reassessments of Mau Mau's meaning. Was it a war for land or for political freedom? Was it a class war within the Kikuyu or did it represent something wider? Most analysts have relied on existing material; these books use new sources. Anderson has reconstructed a vivid slice of history from the court records of Mau Mau trials. Some 3,000 were tried in special courts, 1,574 were convicted and 1,090 hanged. That was more than all the other uprisings the British faced in the last phase of the colonial period put together. The court evidence is a rich seam containing the family backgrounds of Mau Mau members and extraordinary personal details and anecdotes.

Elkins uses oral testimonies of the victims, mostly supporters of Mau Mau who survived the camps and whom she has interviewed. The cover says she spoke to hundreds but in the text there is no mention of how many or who she spoke with. Her main sources are mostly already public. The interviews with detainees - especially women - will tear your soul but Elkins does their cause no favours by drenching her writing in heavy sarcasm. After a while she loses the inverted commas around words like British civilisation so it is hard at times to know if she means "so-called civilisation" - in the name of which disgusting atrocities were perpetrated - or whether she is referring to the schools, hospitals and roads that the British brought in their wake. Where Anderson gets inside the minds and passions of both sides and, best of all, inside the agony of those simply caught up in the horror and forced to make appalling choices, Elkins remains rigidly one dimensional in her understanding.

In Kenya today there are the stirrings of truth and reconciliation movements as families of Mau Mau and "loyalist" Kikuyu meet and talk about the tragedy that tore their grandparents' generation apart. Mass graves are found, burial places marked. The government has backed a commission to investigate. Kenya is finally facing the past. It is a pity Britain's leaders cannot be bothered to do the same.