Chadian forces backed by tanks and helicopter gunships struggled to repel a rebel assault on the capital Sunday , the French military said , and insurgents claimed to have trapped the president in his palace .