Rahmat Shah, who made 76, and Ihsanullah Janat with an unbeaten 65 put on 139 for the second wicket as they chased down 147 to win the match played in Dehradun, India.
Resuming at overnight score of 29 for the loss of one wicket, Janat carried his bat through with an unbeaten 65 off 129 deliveries.
Earlier, spin sensation Rashid Khan claimed five wickets to bowl out Ireland for 288.
Rahmat Shah was declared Man of the match for his 98 and 76 runs respectively in two innings of the match.
Both sides were playing their second Test after making debuts in the five-day format last year.
After the win, Afghanistan's captain Asghar Afghan said, "Happy. It's a historic day for Afghanistan, for our team and our people".
"We have been playing for a while, we have been playing first-class cricket, so we have that composure. The bowlers were very good, Rashid, Yamin. Now we're going to South Africa for World Cup preparation. We will try out best to play good cricket," he said.