The attack occurred at the Damascus Gate entrance to the Old City. Security forces were searching the area for possible accomplices.
According to Israeli authorities, the Palestinians were approached by border police. One showed an ID, but a second drew a gun and began shooting.
Officers opened fire and killed the attackers, police said.
A wave of Palestinian knife, gun and car-ramming attacks erupted in October. Most of the attacks have been stabbings, although there have also been occasional shootings.
At the same time, 164 Palestinians have been killed by Israeli forces, most while carrying out attacks but others during clashes and demonstrations.