The attack took place in west Jerusalem near the city's central bus station, where large numbers of soldiers catch buses each Sunday morning back to their bases after a sabbath break at home.
"A private security guard who saw the event overpowered the terrorist until police arrived at the scene. The terrorist is under arrest," a police statement said.
It was the second attack in Jerusalem in less than 24 hours.
A Palestinian man tried to stab an Israeli policeman on Saturday near the Old City and was shot dead by other officers, a police spokeswoman said.
More From This Section
Many of the Palestinians killed have been attackers while others have been shot dead by Israeli security forces during clashes.
On Friday, Israeli border guards shot dead a Palestinian woman who tried to ram a car into them in the West Bank, shortly after a Palestinian was killed in clashes with Israeli forces near the border with the Gaza Strip.
A number of Palestinians have attempted attacks with kitchen knives in what some analysts have described as virtual suicide missions.
Pope Francis, the leader of the world's 1.2 billion Catholics, used his traditional Christmas Day address to urge Israelis and Palestinians to resume "direct dialogue", saying the conflict had "serious repercussions" on the Middle East.
US-backed peace talks between the Palestinians and Israel collapsed in April 2014 after nine months of fruitless meetings amid bitter recriminations and mutual blame.