Malaysia under-23 national team Khairul Fahmi made his first appearance for
Malaysia under-23 at the
2010 Asian Games. He helped his team qualify into the second round but later lost to Iran, 1–3. Khairul Fahmi became Malaysia's hero when he saved two penalties and they won 4–3 in the penalty shootout after a 1–1 draw against Indonesia to ensure Malaysia retained the prestigious SEA Games gold medal. Khairul Fahmi also helped his team qualify into the Men's Asian Qualifiers Preliminary Round 3 of
2012 Summer Olympics Qualification. However, Malaysia failed to win any matches in the group stage.
Malaysia senior national team Khairul Fahmi made his debut against
Oman on 3 September 2010 replacing
Sharbinee Allawee during the second half. He kept a clean sheet for the entire second half after Malaysia conceding 3 goals in the first half of the match. In November 2010, Khairul Fahmi was called up to the
Malaysia national team by coach
K. Rajagopal for the
2010 AFF Suzuki Cup. Khairul kept a clean sheet against
Thailand on a 0–0 draw. He also kept a clean sheet against
Vietnam twice in the semi-finals. In the first leg of the finals, Khairul Fahmi played well against the Indonesians. The match ended a 3–0 win to Malaysia, thus earning another clean sheet to him. In the second leg of the finals held in Indonesia, Khairul Fahmi gave another outstanding performance by making numerous saves including a brilliant penalty save early in the match. The save proved to be a pivotal moment in the match in which Malaysia scored an away goal. Malaysia won on 4–2 aggregate and lifted the 2010 AFF Suzuki Cup title for the first time. Khairul Fahmi was selected for the
2012 AFF Suzuki Cup. On 26 November 2012, Malaysia's opening group match against Singapore ended up with the Malaysian side losing 0–3. The Lions scored the first goal through their captain,
Shahril Ishak at the 32nd-minute. Six minutes later, Ishak once again scored a goal for the Lions as a result of Khairul Fahmi's blunder at goal. In the second half, veteran Singaporean forward
Aleksandar Đurić completed the rout against the Tigers with the third and final goal of the game. The match resulted in
2012 AFF Suzuki Cup holders Malaysia losing its first group match of the tournament, and Khairul Fahmi was subsequently dropped for the rest of the Tigers' campaign. However, since
Kim Pan-Gon was made in charge of the
Malaysian national football team in 2022, he was deemed too short to play in goal, losing his spot to taller and younger goalkeepers. ==Career statistics==