Miguel Angel Lopez (Astana), was second on the 181km stage from Nice to Col de Turini with Nicolas Edet (Cofidis) third and Mitchelton-Scott's Simon Yates fourth.
Bernal, who took the overall lead from team-mate Michal Kwiatkowski leads the general classification by 45 seconds ahead of Philippe Gilbert (Deceuninck-QuickStep) and Nairo Quintana (Movistar).
"While I am very happy to be wearing the leader’s jersey, I have mixed feelings because my teammate Kwiato was in the leader’s jersey and lost it today," Bernal said. "But I think he had the pressure [of being the leader] for a few stages and he did very well, but with Gilbert in front, we had to go full gas today.
“It was a really hard stage, it was strange for the legs having had lots of flat terrain and wind to contend with earlier in the race to suddenly be in the mountains, but in the final, I was in the front and able to do well.
"Now we have kept the jersey in the team we have to give our best tomorrow. I have a good chance to win Paris-Nice, tomorrow but it will be a tough stage, it always is, and we will have to concentrate all day. Now I have the pressure on me, I am really confident in this really good team and I will try my best to win the race.”
The stage ended with a steep 15km climb where the Colombian climbers, Martinez, Lopez, Bernal and Quintana, had a field day, with the stage winner proving strongest on the day.
"The break was a very strong one and I knew the qualities of each rider in it," Martinez said. "I analysed each one of them, knowing that the mountain always puts you back in your place.
"In the finale, we really watched each other. I knew what my place was. I was tired but I gave everything I had left in the last kilometre. I was more afraid of Simon Yates because he won the TT and was in great form.
"We showed that Colombia was a great cycling power. We are all great friends and it also helps. Even we all compete in our own interest, we're always proud to win for Colombia."
Stage 8 is a short 110km loop around Nice that features six climbs, the last coming nine kilometres from the finish.