WASHINGTON — The shooter who killed 12 people at the Washington Navy Yard on Monday carved two cryptic messages into the wooden stock of his shotgun – “(Better Off This Way)” and “(My ELF)” -- according to a federal law enforcement official.

The messages appear to be the first clue into Aaron Alexis’ possible motive for attacking the base at the start of the work week after spending weeks drifting up and down the East Coast and complaining of hearing voices and believing he was being stalked by three unknown officials.

The messages were carved by either a knife or some other instrument into the wooden stock of the Remington 870 Express shotgun that Alexis bought two days before the shooting, the official said. “The first one (Better Off This Way) seems to have him saying he wanted to kill fellow workers or maybe expected to die himself,” the official said.

[Updated, 12:14 p.m. Sept. 18: The second one, (My ELF), may have been a reference to “extremely low frequency,” and could refer to his belief that someone was penetrating his brain with microwave messages, which he had described to police in Newport, R.I., six weeks ago. It might also be a reference to “Executable and Linkable Format,” a computer coding term that Alexis, a technician for a Navy contracting firm, would have understood.

But the officials conceded that investigators are uncertain about the meaning of the messages.

“He was a loner,” said the official, who was reading from reports in the case but spoke anonymously because the investigation is continuing. “Who knows what was in his mind? He told people he was crazy.”

The official added that Alexis drove a blue Toyota onto the base and parked near Building 197 with the disassembled weapon hidden in a bag in the car trunk. He got out of the car with the weapon in two parts, snapped it together and walked inside.]

Once he started firing, the official said, Alexis was confronted by a Navy security officer armed with a .40 caliber Beretta semiautomatic. He shot the guard and scooped up the handgun, continuing to fire at employees inside.

ALSO:

Gunman got Navy Yard access despite red flags

Ohio man who confessed online pleads guilty to vehicular manslaughter

Colorado flooding makes for unforgettable vacation

Follow L.A. Times National on Twitter

Richard.Serrano@latimes.com