Aleksandra Wozniak of Blainville, Que., and Stephanie Dubois of Laval, Que., also received a spot in the women's doubles draw.
Wozniak was already on the Canadian team in singles while Pospisil had been selected as Daniel Nestor's men's doubles teammate.
Milos Raonic of Thornhill, Ont., Canada's top-ranked player, had already earned a spot in men's singles.
The Olympic tennis tournament will be played at the All England Club, the same venue that hosts Wimbledon.
Pospisil was eliminated from Wimbledon on Tuesday but is looking forward to returning to the famous grass courts next month.
"I'm really excited," he said. "It was a big surprise today that I got the wild card, I wasn't expecting that. It's going to be great to be playing in two events, the singles and the doubles. I'm really looking forward to that."
Also on HuffPost