Pakistan announced it had reopened a major border crossing with Afghanistan on Saturday, more than three weeks after at least 15 people were killed when troops from both sides exchanged fire for several hours.

The Chaman crossing into Afghanistan's Kandahar province was reopened on "humanitarian grounds" after Afghan officials submitted a request, according to a statement by the Pakistani military.

The move to reopen the crossing comes on the first day of the Muslim fasting month of Ramadan in Pakistan.

Pakistan and Afghanistan have agreed to maintain a ceasefire in the border town of Chaman, where nine Pakistanis and six Afghans were killed on May 5, according to the statement.

Pakistan claims the violence began when Afghan forces opened fire on census workers and troops escorting them. Kabul blames Pakistan for initiating the gunfire.

READ MORE: Pakistan-Afghanistan crossing closed after border clash

Mohammad Sharif Gharzi, an official from the Afghan passport department at Spin Boldak, said the border reopened around 4pm local time on Saturday after negotiations between officials from both countries.

"We welcome the opening of the border between Afghanistan and Pakistan at Spin Boldak," said Gharzi.

He added that, given the pressure on locals fasting during Ramadan, this was "great news for all".

Pakistan shares a porous, 2,200km-long border with Afghanistan.

Meanwhile, a Pakistani oil tanker driver was killed on Saturday when his vehicle was hit by a mortar round fired by the Iranian border force in the Panjgur area of the southwestern Baluchistan province bordering Iran, said Abdul Jabbar, an administrator in the district.

Abdul Jabbar said the incident would be raised at the upcoming flag meeting of border officials from both countries.