President Barack Obama vowed to find out what turned two young US residents accused of the Boston bombings to hate, after the second suspect was captured alive, ending a week of horror.

Obama said in a brief on-camera statement that the attacks had failed because Americans refused to be terrorized and heaped praise on police and law enforcement services while remembering the dead and injured.