The 56-year-old man, who has not been named, took his own life at a checkpoint on the motorway between Weil am Rhein, in Germany, and Basel, Switzerland, late Sunday, the ATS news agency reported.
He handed his papers in at the border checkpoint as he crossed from Switzerland to Germany, German and Swiss authorities told the agency.
But as the female border guard walked back towards the man's car, the police officer shot himself in the head, authorities said.
He died at the scene.