Valbuena, who came on for Moussa Sissoko in the 80th minute, netted five minutes from time, hid first goal for Les Bleus since 2007 earning a much needed win after two straight defeats.
Euro 2016 hosts France have now won all their matches against Portugal since their last defeat in 1975.
It was a dull game otherwise at the Jose Alvalade stadium, until France, who dominated possession but looked toothless, found the back of the net.
“We put the good ingredients in the game, we had chances, we could have scored earlier,” said France coach Didier Deschamps.
“We controlled the game, especially in the second half.”
Valbuena added: “It was tough but we dug deep, we were in a rare state of mind”.
Deschamps fielded an untypical 4-4-2 formation with Karim Benzema up front with Nabil Fekir, the Olympique Lyonnais forward being handed his first start.
However, the in-form Fekir was replaced in the 14th minute by Antoine Griezmann after sustaining a knee injury.
“There is a problem with his knee ligaments,” said Deschamps.
Anthony Martial, who earlier this week joined Manchester United from Monaco for a reported fee of up to 80 million euros (£58.8 million), started on the bench.
Portugal, who lead their Euro 2016 qualifying Group I, started with Pepe and Ricardo Carvalho in central defence.
France had the first big chance after half an hour when Rui Patricio parried Blaise Matuidi’s low shot with his left foot.
Five minutes from time, Cristiano Ronaldo, who produced a mediocre performance, forced Hugo Lloris into a fine save with one of his trademark free kicks.
Benzema, who was substituted for Martial in the 75th minute, also had his chance with a second-half free kick but his fine effort was tipped away by Patricio.
It was Valbuena who broke the deadlock when he curled a free kick from over 20 metres into the top corner.
The last player to score with a direct free kick for France was Jerome Rothen in 2007 against the Faroe Islands.
France next take on Serbia in a friendly in Bordeaux on Monday.
(Writing by Julien Pretot in Paris; Editing by Ken Ferris)