PESHAWAR, Pakistan (Reuters) - A Taliban spokesman denied on Friday that representatives met an Afghan government delegation this week, after sources in the movement told Reuters that officials from both sides met in Saudi Arabia to discuss security ahead of elections next month.

The Taliban’s main spokesman Zabihullah Mujahid issued a short statement denying the meeting, less than a month before voters are due to go to the polls on Oct. 20 to elect a new Afghan parliament. President Ashraf Ghani’s office declined to comment.

The process has been hampered by fears of attacks on polling stations and campaign rallies. Ensuring the vote passes off smoothly and without violence has been a top priority for the Afghan government and its international partners.

“They requested us to help them conduct peaceful elections,” said one of the Taliban officials, speaking on condition of anonymity.

“The Afghan delegation has agreed with us on the release of prisoners,” he said, adding that some prisoners facing minor charges had already been released and officials had divided up others into three categories, depending on their importance, for future release.

The Taliban, who regard the internationally recognized Afghan government as an illegitimate regime imposed by foreign powers, have generally insisted on negotiating only with the United States but there have been regular unofficial contacts.

Earlier this year, Washington dropped its refusal to talk with the Taliban, saying the United States would be willing to participate in Afghan-led peace talks and U.S. and Taliban delegations met for talks in Doha, Qatar, in July.

The Taliban officials said the meeting in Saudi Arabia came after plans for another meeting with American officials broke down over U.S. demands for a three-month ceasefire.

“Some of our senior people were not in the favor of holding talks with the Afghan government as until now we were calling them puppets and refused to meet them,” said one senior Taliban leader in Qatar.

“But our proposed meeting with the Americans failed to take place due to certain reasons,” he said.

The U.S. State Department declined to comment.

The officials said U.S. demands for a ceasefire was something the leadership could not agree to. As a result, no formal meeting was held although there were informal contacts.

“Our agreement for holding the meeting was only to discuss prisoner exchange and the removal of our people from the U.N. black list so they can travel,” said one senior Taliban leader from the movement’s political office in Qatar.