"We handed over the two to a third party after we got two of the three people we wanted to be freed," Yousuf said.
A provincial official said two Taliban were released late on Saturday night. They were spokesman Latif Hakimi and a leader known as Ustad Yasar, Yousuf said.
The pair were arrested in Pakistan in 2005 and later handed to Kabul.
Media reports said Mastrogiacomo's driver was executed on Thursday.
The Taliban had threatened to execute the journalist unless its demands were met.
On Saturday, they extended their deadline to give Rome more time to respond.
Mastrogiacomo and his two colleagues were seized in the southern province of Helmand last week, where NATO and Afghan forces this month launched a major offensive, and the Taliban said he had confessed to spying for British troops.
La Repubblica denied he was a spy and said he had been working for it since 1980.