Afellay and his family are Moroccan Dutch. After both the Moroccan and the Dutch national teams managers selected him for their squads, he was caught in the dilemma to either play for the Moroccan national team, because of his Moroccan descent, or to play for the Dutch team, the Netherlands being his place of birth and residence. He ultimately decided to play for the Dutch national team despite the heavy competition for places in midfield. He made his international debut in a Euro 2008 qualifier against Slovenia on 28 March 2007. He played in the 2008 European Championships as a substitute. Just seconds after replacing Dirk Kuyt in the group match against Italy he nearly scored a goal but his shot hit the top of the crossbar. In their last group match against Romania, he was given a place in the starting eleven alongside Arjen Robben in midfield. On 12 October 2010, Afellay scored his first international goals in a Euro 2012 qualifier against Sweden.