BMW Motorrad Motorsport rider Melandri, second fastest in free practice earlier on day one, sped to a second lap of one minute and 43.196 seconds.
Eugene Laverty of Aprilia was second-fastest than half a second behind the Italian, with Brits Tom Sykes - fastest in FP1 - and Jonathan Rea in a top four comprised of four different teams.
Leon Haslam and Leon Camer made it an all-British four from third to sixth ahead of Max Biaggi in seventh.
Portimao qualifying session one:
1. Marco Melandri (BMW Motorrad Motorsport) BMW S1000 RR 1'43.196
2. Eugene Laverty (Aprilia Racing Team) Aprilia RSV4 Factory 1'43.580
3. Tom Sykes (Kawasaki Racing Team) Kawasaki ZX-10R 1'43.731
4. Jonathan Rea (Honda World Superbike Team) Honda CBR1000RR 1'43.886
5. Leon Haslam (BMW Motorrad Motorsport) BMW S1000 RR 1'43.921
6. Leon Camier (FIXI Crescent Suzuki) Suzuki GSX-R1000 1'43.949
7. Max Biaggi (Aprilia Racing Team) Aprilia RSV4 Factory 1'43.996
8. Carlos Checa (Althea Racing) Ducati 1098R 1'43.999
9. Michel Fabrizio (BMW Motorrad Italia GoldBet) BMW S1000 RR 1'44.373
10. Chaz Davies (ParkinGO MTC Racing) Aprilia RSV4 Factory 1'44.390
- Jonathan Rea
- Eugene Laverty
- Tom Sykes
- Max Biaggi