The Serbia international returns to Portugal after making just 34 appearances for Liverpool since arriving from Benfica in 2014.
Markovic – who scored three goals during his time at Anfield – has struggled to break into the first team in the Premier League, and was sent out on loan last season with Fenerbahce.