Carlos Bacca scored four minutes from time to secure three points for AC Milan against Sampdoria.
The Colombian striker only joined the fray as a 64th-minute substitute, replacing Gianluca Lapadula, but looked lively from the moment he came on.
Bacca thought he had fired the winner on 73 minutes, only to see his shot deflected onto the post by goalkeeper Emiliano Viviano.
But he finally made the breakthrough with a neat right-footed finish late on to send Milan up into the top half with six points from their opening four matches.
Sampdoria will feel aggrieved to finish the game empty handed after dominating possession, but Samp remain in the top half themselves after two wins from their opening three games.
And on balance the result was about right, with Milan also arguing that they should have been awarded a penalty when Giacomo Bonaventura was tripped four minutes before Bacca's goal.