Giant pandas are the closest relatives of all of the living bears. The giant Panda evolved into a different lineage before all the living bears split from one another. Therefore it is less bear-like than the other bears, and it is why it was considered a relative of the raccoon by some before molecular data become available. Raccoons are also close relatives of the bears. The giant panda can be considered a primitive bear.
The red panda was once considered the closest relative of the giant panda, but it is now considered only convergently similar to the giant panda. The red panda is sometimes placed in the raccoon family or it is placed in a family of its own. Recent data suggests that it is a primitive member of the raccoon family