Portugal, who booked their place at the tournament in Germany next summer with a win over Slovakia last Friday, continued their superb form under the Spanish coach with their eighth victory in eight games since he arrived.
Ronaldo netted his 126th and 127th Portugal goals, further extending his record as the top all-time men’s international goalscorer.
Manchester United’s Bruno Fernandes added the third before Barcelona duo Joao Cancelo and Joao Felix joined in the fun, all before half-time.
Bosnia, led by veteran target-man Edin Dzeko, languish fifth and can no longer progress from the group after Slovakia beat Luxembourg 1-0.
Bosnia have two games remaining and are seven points behind second-placed Slovakia in Group J, with Portugal the runaway leaders.
Martinez’s side have scored 32 goals and only conceded twice, racking up all 24 points possible so far.
Al-Nassr striker Ronaldo, 38, opened the scoring from the penalty spot and dinked home his second with a neat finish, but was replaced by Martinez after 65 minutes, while still in search of his hat-trick.
The former Real Madrid forward was also confronted by a pitch invader shortly before half-time, but stewards swiftly intervened.
Fernandes and Cancelo finished with sublime accuracy and power as the hosts’ defence crumbled miserably, while Felix stroked in the fifth.
Bosnia tightened up in the second half but it was far too little, far too late.
AFP