Nepal conceded both goals in the second half soon after skipper Jagajit Shrestha was replaced by Hemant Thapa Magar in the 75th minute.
Nepal, after being defeated by host Iran 5-0 in its opener on Monday, had control of the game in the first half although this did not create clear chances. Nepal failed to score despite having ball possession.
Khalid Ahamad Mohammad Sharif gave Afghanistan a lead in the 76th minute, utilizing poor defense as well as goalie Bikesh Kuthu's poor judgment.
Earlier, Bimal Gharti Magar, who did not play against Iran, was replaced by Amar Dangol in the 72th minute as he was injured in the game.
Although the Afghan players fired some shots at the goal post late in the match, the game was still under control for Nepal until it conceded the killer blow in injury time.
Nepal went down 2-0 in the added time of the second half through spot kick. Sayed Mohamad converted the penalty he earned after substitute Sulav Maskey fouled him in the danger zone.
The defeat means Nepal has to win its matches against both Saudi Arabia and Palestine to keep alive its chances of advancing into the next round.
Nepal will play Saudi Arabia on March 29 at the PAS Stadium in Tehran and its last match at the same venue against Palestine on March 31.
Nepal's coach Jack Stefanowski said that his side failed to execute the plan and lost Wednesday's must-win match.
Nepal's starting XI
Bikesh Kuthu, Aakash Thapa, Aditya Chaudhary, Anant Tamang, Prakash Budhathoki, Bimal Ghartimagar, Jagajeet Shrestha, Hemant Gurung, Anjan Bista, Bishwash Shrestha, Bishal Rai.
Nepal fancies win against struggling Afghanistan to keep qualif...