Bangladesh beat Pakistan by 37 runs to set up a meeting with India in the Asia Cup final.
Batting first, Bangladesh were reduced to 12-3 before Mushfiqur Rahim’s 99 helped them to 239 in Abu Dhabi. Junaid Khan finished with 4-19.
Imam-ul-Haq made 83 in reply but Pakistan lost wickets regularly, with pace bowler Mustafizur Rahman taking 4-43 as they fell short on 202-9.
Bangladesh face defending champions India in Dubai on Friday.
India won by seven wickets when the sides met in the Super Four stage.
India, who had qualified for Friday’s final, needed seven off the final over and one from the last two balls in the dead-rubber Super Four match.
But Ravindra Jadeja top-edged a pull off leg-spinner Rashid Khan to mid-wicket to fall for 25.
Mohammad Shahzad made 124 and Mohammad Nabi 64 in Afghanistan’s 252-8 as Jadeja took 3-46.
Pakistan face Bangladesh in Abu Dhabi on Wednesday to decide who will play India in the final in Dubai.
India players on the dressing room balcony celebrated what seemed a certain win after Jadeja hit the second ball of the final over for four.
But 20-year-old Rashid, who starred for Sussex in this summer’s T20 Blast, held his nerve to secure the 36th tie in one-day international history.