Apollo incident at Pollux IV

An ancient god demands worship

At Pollux IV, a powerful being who had been worshipped on Earth as the god Apollo seized the Enterprise and demanded that its crew stay as his worshippers.

In 2267 the Enterprise was stopped near Pollux IV by a vast energy hand. On the planet, the landing party met Apollo, a member of a race of powerful beings who had visited ancient Greece and been worshipped as gods. Apparently the last of his kind, he wanted the humans to remain and worship him, and he took an interest in the historian Lieutenant Carolyn Palamas.
Kirk refused. The Enterprise found that Apollo drew his power from his temple, and the ship's phasers destroyed it. Grieving, Apollo accepted that humans had outgrown the gods and faded away into the wind.