Khaled took four wickets, including that of Shehan Madushanka off the last ball, with the visitors needing three runs to win.
Madushanka had already struck three sixes in his 12-ball 21, which nearly took Sri Lanka to victory at the death, but they were eventually bowled out for 278 after Bangladesh had put up 280 for 7.
Sri Lanka's top four got out cheaply as they slipped to 72 for 4, before Ashan Priyanjan and Dasun Shanaka added 84 runs for the fifth wicket. Shanaka top scored with a run-a-ball 78 that had six sixes and two fours. However, Khaled had him caught in the 46th over to give Bangladesh a huge opening.
Shoriful took three wickets, while Ariful Haque took two wickets to go with a big-hitting 47 off 22 balls. He struck four sixes and three fours as he helped Bangladesh put up a competitive total in 50 overs.
Mizanur Rahman had earlier top scored for Bangladesh, making 67 off 107 balls, while captain Mohammad Mithun made 44.
The second one-day match will be held at the same venue on July 19.