The Taliban claimed responsibility for the attack, which came as reporters were gathering for a news event on Afghan youth at which President Hamid Karzai was expected to talk about ongoing efforts to open peace talks with the militant group.
The palace is in a large fortified area of downtown Kabul that also includes the US Embassy and the headquarters for the NATO-led coalition forces. Access is heavily restricted. It houses Karzai's residence but it was not immediately clear whether the president was in the building at the time and his spokesman did not answer his phone.
Kabul police chief Gen. Mohamad Ayub Salangi said three or four gunmen jumped out of their SUV and opened fire after being stopped by security forces while trying to use fake documents to get through a checkpoint. All gunmen were killed, and one palace security guard was wounded, he said.
A car bomb then exploded as it tried to enter the area. About 20 journalists took cover behind a religious shrine, pulling a schoolboy off the street who had been caught in the open on his way to school.
Smoke could be seen coming from the area of the hotel, but there was no immediate indication any of the buildings were hit in the attack.
Mujahid claimed the attackers had inflicted "heavy casualties," but Afghanistan's Kabul division army commander Gen. Kadam Shah Shahim said he knew of no deaths among security forces or civilians.