The Soviet spacecraft Luna I became the first to pass the moon.

As the craft headed for the Sun’s orbit it, came within just 3,700 miles of the moon.

Source