One gunman involved in the deadly attack has died from gunshot wounds shortly after he was arrested by Kenyan security forces, the Kenyan Presidency said on Twitter.
The al-Qaeda-linked militant group, which is battling peacekeepers from Kenya and other African nations, said the mass shooting was justice for crimes committed by Kenyan troops in Somalia.
"For long we have waged war against the Kenyans in our land, now it's time to shift the battleground and take the war to their land," al-Shabaab said on its official Twitter handle @HSM_Press.
The rebels said on Twitter its warnings of "severe consequences" for Kenya's military presence in Somalia had been ignored, hours after unidentified gunmen attacked a Nairobi shopping mall.
Shabaab said it had "on numerous occasions warned the Kenyan government that failure to remove its forces from Somalia would have severe consequences", without directly claiming responsibility for the assault on the Westgate mall.
Militant gunmen stormed a shopping mall in Nairobi on Saturday killing at least 25 people, including children, and sending scores fleeing in panic from shops and restaurants onto the streets, according to witnesses and the Red Cross.
Shooting continued hours after the initial assault as troops surrounded the Westgate mall and police and soldiers combed the building, hunting down the attackers shop by shop. A police officer inside the building said the gunmen were barricaded inside the Nakumatt supermarket, one of Kenya's biggest chains.