In a joint statement, the cricket boards said the One Day International (ODI) series will begin on September 27 in Karachi where they will play the other two ODI matches on September 29 and October 2.
The Sri Lankans will then move to Lahore for three T20 matches starting on October 5 and the final match will be on October 9, with the second match scheduled for October 7.
This will be Sri Lanka's second tour of Pakistan since their team bus was attacked by militants during a Test match in Lahore in March 2009.
Eight years later, the Sri Lankans returned to Pakistan for a Twenty20 international in Lahore in October 2017.
The two boards said the teams were due to play two Test matches in October and follow it up with the six shorter form matches in December, but decided to swap them.
The dates and the venue for the two Tests were not announced, but Sri Lanka's Sports minister Harin Fernando told reporters in Colombo Thursday that the Tests will not be in Pakistan.
Citing safety fears, Fernando said two Tests could instead be played in the United Arab Emirates (UAE), where Pakistan has held many of its home series.
Since the 2009 attacks, a majority of international teams have refused to tour Pakistan over security fears, forcing Pakistan to play their home matches at neutral venues.
But since hosting Zimbabwe for a limited over series in 2015, Pakistan have been gradually normalising cricket activities and have also hosted matches for its professional Twenty20 league for the past three years.
They have also hosted a World XI and the West Indies for limited over matches in 2017 and 2018.
September 27 - 1st ODI, Karachi
September 29 - 2nd ODI, Karachi
October 2 - 3rd ODI, Karachi
October 5 - 1st T20I, Lahore
October 7 - 2nd T20I, Lahore
October 9 - 3rd T20I, Lahore