Lawless stayed close to van Avermaet, who started the day six seconds in arrears, to secure the overall by just two seconds ahead of the CCC Team veteran.
Third place on the stage and overall went to Lawless's INEOS team-mate Eddie Dunbar.
“If someone had told me that I’d win this race when I was coming here I’d call them a bare-faced liar,” Lawless said.
“I didn’t think it was possible. I managed to get over Chevin without getting dropped, about halfway up I started losing the main guys but [Owain] Doull did a really good job of getting me back over Chevin.
"When Greg went I knew we already had Eddie up the road so I knew I just had to follow him.”
Van Avermaet salvaged his spring with the stage victory.
"I am really happy that I won the stage. Winning the overall title would maybe have been better but in these circumstances, with Team INEOS being that strong, it wasn't possible," he said.
"I think I made a good move, attacking on the last climb to bridge over to Dunbar. Lawless was still on my wheel at that point but, it was the only option to try to win something."
“I was fighting from Omloop Het Nieuwsblad to Liège-Bastogne-Liège for a win and I missed out on a win in my bigger goals. Of course, I was disappointed in those races as I was expecting more from myself. This win makes it a little better as it’s a nice way to end this first part of the season but for sure, the Classics was my bigger goal.”