Yahia was the first footballer to profit from the 2004 change in FIFA eligibility rules as he had played as a French youth international.
After his switch of national allegiance he was called up to the Algeria Under-23 side, scoring on his debut in a 1–0 win against Ghana in an Olympic Games qualifier on 2 January 2004.
A few days later he was called up to a training camp held in Algiers in preparation of the 2004 African Nations Cup.
At international level, Yahia played for the Algeria national team prior to his retirement from international football on 1 May 2012.
He is considered to be a national hero by many Algerians, as he was the scorer of the goal that put them into their first World Cup finals since 1986, at the expense of bitter rivals Egypt.
He struck in the 40th minute of the play-off by scoring a Marco van Basten-esque goal.
Whilst representing Algeria, he participated in two continental tournaments 2004 Africa Cup of Nations and the 2010 Africa Cup of Nations, the latter in which Algeria finished fourth, and the 2010 World Cup in South Africa.
Overall, he had participated in fifty-three official games for the Algerian national team, in which he had scored six goals.
He captained the Algeria national football team during the 2010 World Cup in South Africa, holding the position from June 2010 to May 2012.