The accused attacked the victim after finding out he was talking to the girl in question, the Etemad daily said.
"I have killed him but not intentionally," the young man, identified only with his first name, Safar, told the court.
"I did this because I was inexperienced and I was angry. I ask them (the family of the victim) to forgive me," he said.
But the victim's father said Safar had killed his son Mehdi and deserved the punishment. "I don't know the reason why they got into a fight but Safar has killed my son and he should be killed," he said.
Amnesty International has called Iran "the last executioner of children", referring to people convicted of crimes committed when they were under the age of 18.
The rights group said in a report published in June last year the Islamic Republic had executed more child offenders than any other country since 1990. In many cases, it said, convicted offenders were kept in prison and executed after they turned 18.
U.S.-based Human Rights Watch in December said Iran was known to have executed two juvenile offenders earlier in 2007, accusing the country of flouting its human rights obligations.
Iran rejects the criticism. It says it implements Islamic law, sharia, under a system in place since the 1979 revolution.
Murder, rape, adultery, armed robbery, apostasy and drug smuggling are all punishable by death in Iran.
European governments and Western rights groups have criticised Iran for an increasing number of hangings since authorities launched a clampdown on "immoral behaviour" in July.
Amnesty last week listed the Islamic state as the world's second most prolific executioner in 2007, after China. It said in a report Iran had executed at least 317 people last year compared with at least 470 in China.