The British & Irish Lions have won the first Test on their tour of Australia with a 23-21 victory in Brisbane.
Halfpenny kicked the conversion to put the away side 10-7 in front and extended their advantage on 32 minutes with another penalty.
Australia scored their second try five minutes before the end of a thrilling first half when Folau showed quick feet to go over. However, O'Connor was unable to kick between the posts as the Lions stayed ahead by a single point.
Halfpenny could have put the Lions further ahead with a penalty in stoppage time, but the Welshman missed the posts.
The tourists started the second half positively and were rewarded when Alex Cuthbert cut open the Aussie backline to touch down on 49 minutes. Halfpenny was able to add the extras to push his side eight points clear of their opponents.
James O'Connor and replacement Kurtley Beale then both scored penalties for the hosts to bring them to within two points of the Lions with 20 minutes to play.
A third Halfpenny penalty took the pressure off the Lions briefly before Beale kicked his second penalty to restore his side's two-point deficit with 10 minutes left on the clock.
Beale had the chance to give Australia the victory twice in the final five minutes, but he kicked two penalty opportunities wide.