A Pakistan embassy official who was seized in Iraq two weeks ago has been freed, the chief Pakistani government spokesman said.