In a message to the nation on a major Muslim holiday, the Afghan president said Friday that negotiations with the Taliban are the only way to "end the bloodshed" and bring peace to the country.

But even as Ashraf Ghani spoke, a bomb ripped through a mosque compound in northern Balkh province after prayers for the Eid al-Fitr holiday, which follows the fasting month of Ramadan.

Sarajuddin Abid, the district governor of Sholgara where the explosion happened, said two people were killed and 12 were wounded in the blast.

No one immediately claimed responsibility for the attack.

Ghani, who spoke at the presidential palace in the capital, Kabul, has made peace talks with the Taliban a priority for since he was elected president last year. This was his first Eid message to the nation.

"The negotiations are the solution, the way and this is what our nation wants, to end the bloodshed," Ghani said.

He also thanked Mullah Mohammad Omar, the reclusive Afghan Taliban leader, for endorsing the peace talks and said it was important the Taliban "want to join the political process."

Earlier in July, neighboring Pakistan hosted the first face-to-face Kabul-Taliban talks, supervised by U.S. and Chinese representatives. The meeting was said to have made progress, with the two sides agreeing to work on confidence-building measures and hold more such meetings after Ramadan.

In the wake of the departure of NATO combat forces at the end of last year, the Taliban have stepped up attacks on Afghan troops, which are now in charge of security in the country, and are also targeting government officials.

Ghani has in the past sought Pakistan's help in bringing the Taliban to the negotiations, since Islamabad is believed to wield influence over the group.