SHALIMAR, Florida — A gunman fatally shot a sheriff's deputy outside a lawyer's office on Tuesday and then barricaded himself inside a motel, where he exchanged gunfire with other deputies and was killed, authorities said. Joel Dixon Smith, 33, was being served a domestic violence restraining order at the lawyer's office and was supposed to be turning over his guns to Okaloosa County Deputy Bill Myers, 64, when he pulled out a concealed weapon and shot the deputy multiple times in the back of the head and back, authorities said. Sheriff Larry Ashley called Smith “a sick little coward.” Smith, a postal worker, fled in his vehicle, heading to a Comfort Suites motel about 10 miles (16 kilometers) away in Niceville, where he had previously booked a room. He barricaded himself inside and deputies fired tear gas into his room. He charged out firing and was shot by deputies, Ashley said. No one else was hurt. Smith had been arrested in 2008 for domestic battery, Ashley said, but had no other details. The restraining order was meant to protect Smith's wife. Smith was a rural carrier for the Postal Service, beginning in Niceville in 2013, the agency said in a brief statement. Annie Allen works at an awning business next to the law firm. Allen said she and her boss were starting their day when six to eight gunshots rang out. “We heard ‘pop, pop, pop,'” she said. Allen called the emergency dispatcher, and her boss, store owner David Wray, went to check things out. Wray said he initially thought there had been a robbery at a nearby Dollar General store. He spotted Myers' patrol car and ran over with the intention to tell a deputy about the possible robbery but instead saw a wounded Myers. Wray said he was stooped over Myers when a nicely dressed man walked out of the law office. Wray said he asked the man if anyone had called the emergency dispatcher, but the man just continued to his truck. That's when another woman screamed that the man was the shooter. “It was like I was in a movie,” Wray said. “I just couldn't believe any of it.” Wray said he used his phone to take photos of the fleeing truck. He said he then got into his own vehicle and tried to follow. “I thought I'd chase him, but there was a lot of traffic,” Wray said. “I'm not James Bond. I didn't want to get anybody hurt, so I went back.” At the scene of the shooting, Wray said he and another man tried to talk to the deputy, but he didn't reply. “It was the saddest thing I'd ever seen,” Wray said. “I cradled his head for a while. He was bleeding profusely.” A Comfort Suites guest, David Bump of Ozark, Alabama, said he awoke Tuesday to deputies pounding at his room. Bump said officers took him and other guests across the street, where they spent hours watching the standoff. “When they brought the guy out, he was on a gurney with his face covered,” said Bump, who was working in the area as part of a construction crew. — AP