Los Angeles Times Staff Writer

In the final hours of his life July 5, Army Maj. James M. Ahearn was doing what he did best: looking out for the interests of others.

From his quarters in Baghdad, he tried to assure family members in the U.S. that he was safe and upbeat.

Then he headed across town to try to assure local Iraqis that eventually things could be upbeat and safe for them too, if everyone worked together.

He was on his way to that neighborhood meeting when a homemade bomb blew up next to his truck. He was killed instantly, along with a sergeant from his 95th Civil Affairs Brigade.

Ahearn, 43, of Concord, Calif., was buried Wednesday at Arlington National Cemetery. His younger brother, Kevin, delivered the eulogy, describing him as a hero in life as well as death.

An 18-year veteran whose career included duty in the Persian Gulf War as an enlisted man assigned to a tank crew, Ahearn was nearing the end of his third tour of duty in the current Iraq conflict. And he seemed to understand the country like few Americans do.

He learned to speak Arabic and moved comfortably among Iraqi villagers and officials. During Baghdad duty in 2003, he met and fell in love with an Iraqi woman. He brought her to the U.S. in 2005, and they married and had a baby girl.

On this tour, Ahearn was working to develop relationships with Iraqi civilians and improve relations among rival groups. There were signs that work was starting to pay off, he told family members.

“Cautiously optimistic is a very good way of putting it,” he wrote in early June. “The last 36 hours have been very encouraging for me: had a meeting with an Iraqi general, pitched my ideas for civil affairs projects in one of his neighborhoods. Had a meeting in the neighborhood with a bunch of local leaders who were insistent that they don’t want handouts; they just need some assistance to get things going.”

The neighborhood where he was killed had been car-bombed a few weeks earlier, leaving six dead and several dozen injured. The sectarian attack had been intended as a catalyst to divide residents, Ahearn explained. Instead, it had united them.

“This neighborhood -- Sunni, Shia, Christian and Kurd -- came together. They cared for the injured, put up the homeless, built makeshift barriers around the neighborhood to prevent such a thing from happening again,” he wrote in an e-mail to family members.

Ahearn had met his future wife, Lena, in Baghdad’s Green Zone when he stopped by her family’s home to check on their welfare. She had been working at the time as a military translator.

“It was love at first sight, but we didn’t want to say it,” Lena Ahearn said. “Jimmy was the greatest gift I ever had.”

Ahearn impressed those who watched him give food to Iraqi families and things such as soccer balls to children.

“He was taking care of the Green Zone where we were staying. He was very friendly, helping everybody. He saw his job as helping rebuild, not fighting,” recalled Lena’s sister, Mariam Ghadeer.

When Lena agreed to marry him, he set out to convert to the Muslim faith so the ceremony could take place. Then he worked to bring her to the U.S.

His father, retired Phoenix-area FBI head James F. Ahearn, helped him snip through immigration red tape, eventually enlisting the assistance of Sen. John McCain (R-Ariz.). The couple settled in Raeford, N.C., near the Army’s Ft. Bragg, where Ahearn’s 96th Civil Affairs Battalion was based. His mother, Connie Ahearn, lives in Concord, Calif.

Seventeen months ago, Ahearn’s daughter, Kadi, was born. His redeployment to Iraq began in March, and he was due home in September. He planned to retire from the Army in 2009.

Ahearn’s greatest worry, initially, was that his daughter wouldn’t remember him when he returned. But he also was concerned about the Iraqi children whom he encountered. Snapshots that he sent from Iraq nearly always depicted children, friends say. He encouraged them to ship over toys -- but “no toy guns, please” -- to be distributed to them.

“If we can get through to the kids,” he wrote, “then maybe Kadi can visit here as a tourist instead of as a lieutenant.”

To the end, the American major worried more about the Iraqis’ fate than his own.

“There are a lot of good people here who really are trying to make a difference and need some help. There’s no doubt in my mind that if we left, they’d all be dead,” he wrote in an e-mail to his father. “If we were to get the hell out of here, some poor kid would be left doing the job -- and we’re already losing enough good kids.

“I wish I could just sit all the Iraqi entities down in a room, pitch my plan to rid the place of Al Qaeda, and promise that the Americans will leave shortly thereafter -- or at least take up positions out in the desert on the Iranian border, which the average Iraqi wouldn’t mind at all. I’ll figure out the whole Iran thing later.

“I never realized saving the world was so damned hard.”