The 32-year-old Bosnia-Herzegovina international was due to see his contract at Camp Nou expire in the summer of 2024.
However, Barcelona have confirmed that they have mutually agreed to terminate his contract in order to allow him to join Sharjah FC on a free transfer.
A statement on Barca's official website read: "FC Barcelona and Miralem Pjanic have reached an agreement to release the player from the contract binding the player to the club until the end of the 2023-24 season.
"The club publicly expresses its gratitude to the player for his professionalism, dedication and commitment and for always adapting his contract to the club's situations and needs. It wishes him every success and fortune in the future."
Pjanic is understood to have completed his medical with Sharjah FC on Wednesday, before putting pen to paper on a two-year contract.
A statement from Sharjah FC read: "We welcome the joining of the Bosnian international Miralem Pjanic (32 years old) to our team from Barcelona in a free transfer deal with a two-year contract with the option of extension."
Pjanic joined Barcelona in the summer of 2020 for an initial fee of around €60m from Juventus, with fellow midfielder Arthur Melo moving in the opposite direction for around €72m.
The playmaker made 30 appearances in all competitions during his first season with the Catalan club, but he eventually fell down the pecking order and was sent out on loan to Besiktas last season.
Pjanic suffered with a number of niggling injuries during his temporary spell in Turkey, but he still managed to play 26 times in all tournaments.
The 107-cap Bosnia-Herzegovina international was deemed surplus to requirements by Barca head coach Xavi when he returned to the club over the summer, and he was linked with a number of European clubs including Sporting Lisbon.
However, Pjanic has decided to begin a fresh challenge in the Middle East with Sharjah FC, who are six-time UAE Pro League champions and finished second in the table last season.
Pjanic, who has previously spent time with Metz, Lyon and Roma, could make his debut for Sharjah FC when they travel to Ajman Club next Thursday.
The departure of Pjanic will see his reported €6.5m-a-year wages removed from Barca's wage bill, amid their ongoing financial problems.