This is known as secondary endosymbiosis