BREWER, Maine — Robert Coles, 92, of Machias was only 17 and still a senior in high school in the Bronx, New York, when he joined the U.S. Navy in 1940, unaware that the following year he would be at Pearl Harbor when a swarm of Japanese warplanes attacked.

Coles said he enlisted in large part because he worked long hours as a teenager, didn’t always have enough to eat and was motivated to join the military to escape that drudgery. He also said he figured the United States eventually would be drawn into World War II, and he wanted to be involved.

“You knew damn well, we’re going to be in it pretty soon,” said the former chief petty officer, who set down roots in Washington County after retiring as a chief radioman in 1970 from the U.S. Naval Telecommunications Station in Cutler.

Coles was among about a dozen World War II veterans who traveled to Brewer on Oct. 29 for an appreciation dinner at Jeff’s Catering during which the 75th anniversary of the the Dec. 7, 1941 attack on Pearl Harbor was observed. The event was hosted by the Bangor Veterans for Veterans program with support from the Pine Grove Program.

Coles recalled being sent to boot camp in Newport, Rhode Island, in February 1941. After some more training in San Diego to become a radioman, he was shipped to Pearl Harbor in October.

Given a choice of serving on one of three ships, Coles, who was wearing his sharp dress blues for the veterans appreciation dinner, said he chose the destroyer USS Bagley. The other options were the USS Detroit — a World War I-era destroyer that he said was “ugly as hell” — and the ill-fated USS Arizona, which he did not choose because he knew from having been aboard a similar vessel that he would be subjected to nearly constant bugling.

Coles initially was tested for his skill in Morse code when he reported for duty on the Bagley but because he had not used his skills since June, he did poorly and was assigned to duty as a regular seaman on deck, he said.

But on Dec. 7, Coles did something that went far beyond his regular duties — breaking a few rules in the process, he said.

On the morning of the Japanese attack at Pearl Harbor, the Bagley was tied up at the Navy yard pier. Coles had just left the mess hall, and he was finishing his toast on board the Bagley when he saw a group of airplanes headed his way.

“They had a big red circle on them,” he said, describing the Rising Sun symbol of Japan on the wings. “I didn’t know what I was looking at. I thought for a minute that they were on maneuver and this was the Red Force and that next I would be seeing planes with blue circles on them.

“And then I noticed stuff falling out of the plane, like sand out of a bucket, and bangers blowing up on Ford Island. Here’s where it gets even weirder. I turn and I run up to the port side to [one of the two] .50-caliber machine guns,” he said. Though he had not been trained to fire it, he had observed gunners while on watch duty.

“I took the dog wrench off the bulkhead, broke the padlock on the ammo boxes and I loaded No. 2 .50-caliber machine gun all by myself, and I swear before almighty God that I shot and hit the first two torpedo planes that went by the Bagley. I’m not claiming to have shot them down, no because I didn’t see them go down,” he said. “And just about then, the chief gunner come running up and says, ‘Coles, I’ll take over.’”

He next was assigned to be a plane spotter.

“While acting as a plane spotter, I see a huge, huge black explosion off my port quarter,” he said. He didn’t know it at the time, but it was the USS Arizona blowing up, taking with it 1,177 sailors, he said. “A few minutes later, I noticed behind me this big, huge white explosion. That was the USS Shaw blowing up.”

“I was breathing heavy but I wasn’t scared because everything was happening around me and nothing was happening to me,” he said. Shortly after that, he did get scared while working in the ammo handling room, where he was unable to see what was happening outside.

Coles later learned that the entire attack lasted less than two hours.

“Two thousand, four hundred and three people lost their lives in that one hour and 50 minutes,” he said. The U.S. declared war on Japan the next day.

“What I did during the Pearl Harbor attack I wasn’t supposed to do. It wasn’t my job. I wasn’t trained to [fire machine guns],” he said.

Since retiring in Washington County and marrying a local woman, the late Katherine Vane of Machias, Coles has periodically spoken about the war to area students. He said he asks them, “Did I disobey orders? Yes. Did I do wrong? No. It’s not all black and white. There’s shades of gray in there.”

In early December, Coles will return to Pearl Harbor for the first time since World War II ended.

A GoFundMe page that a friend set up last month to raise the $12,000 needed to send Coles and a traveling companion to Pearl Harbor for the 75th anniversary observances had raised more than $13,500 as of Thursday.

Coles’ friend Dennis Boyd, a Gulf War veteran from Cutler who also served in the Navy, will accompany him.

Coles considers himself lucky to have ended his 30-year Navy career in 1970 without injury, especially since he was involved in 17 battles from Pearl Harbor to Okinawa before his last assignment in Cutler.

“The only blood I shed was when I nicked myself shaving,” he said with a grin.