The 35-year-old former fast bowler announced his decision hours before he was to leave with batsman Mohammad Yousuf to join the squad in South Africa, where Pakistan is due to play three Tests and five One-day internationals.
"I am disappointed that they (Pakistan Cricket Board) wanted me for only the Test series on the South Africa tour, which is mistreatment," Younis told AFP on Sunday.
Younis, who played 87 Tests and 262 One-day matches for Pakistan until 2004, was appointed bowling coach in 2006 for a One-year contract, which was to expire in April this year.
"I have conveyed my decision of leaving the post to the PCB chairman," said Younis, who returned with Yousuf Saturday from Saudi Arabia after performing the Hajj annual pilgrimage.
"Respect is something that the PCB needs to learn. I am a bowling coach and not a clerk," said Younis.
Younis said he made a difference to Pakistan's bowling through his knowledge.
"The improvement in Pakistan bowlers is there to be seen. I took time out from my family commitments to help youngsters, but it is better to quit when you don't get the respect," said Younis, whose family is now based in Australia.
Younis took 373 Test and 416 One-day wickets. He is also tipped to take over as New South Wales coach.
The PCB's director of communication, Ahsan Malik, confirmed Younis had left the post.
Malik said the decision to send Younis for the Tests only and not for the One-day series was taken by the team management.
Younis' resignation is the latest controversy to hit Pakistan cricket, which was plagued by a series of scandals last year.
Pakistan forfeited a Test against England at The Oval -- the first in Test cricket's history -- on charges of ball tampering.
PCB chairman Khan resigned from his post after Younis Khan refused to captain the team, while two Pakistani pacemen -- Shoaib Akhtar and Mohamad Asif -- were tested positive for banned steroids.