Baton Rouge Police Chief Carl Dabadie said that slain officer Montrell Jackson had a heart of service to his community. (Reuters)

On the day Alton Sterling died at the hands of two Baton Rouge officers, a 10-year veteran of the police force made a vow that he shared on Facebook.

“I swear as God is my witness I will do everything in my power to steer my son along a different career path from what I chose for myself. He can do better.”

Those words were written by Montrell Jackson on July 5, 12 days before the new father became one of three law enforcement officers killed Sunday in Baton Rouge. Before the ambush, the gunman had posted YouTube videos advocating more than just protests against police brutality and describing the July 7 shooting deaths of five Dallas officers as “justice.”

But if shooter Gavin Long, a veteran of the Marines who was also killed Sunday, was trying to launch a “war” — a word he used in the videos — between the black community and those who wear blue uniforms, he picked a target who straddled both worlds. He picked a 32-year-old black man who was president of the homeowners’ association in his mostly white neighborhood, a man who not only shared pictures of his 4-month-old baby on social media but also his thoughts on the conflicted space he occupied after several high-profile police shootings of African American men.

“He was the proudest damn police officer I ever knew,” close friend and neighbor Kristi Godal said of Jackson. “And he was a proud black man in his uniform.”

In this 2016 photo provided by the wife of Montrell Jackson, the 32-year-old Baton Rouge police officer holds his son Mason at a Father's Day event for police officers in Baton Rouge. (AP)

Godal, a Baton Rouge real estate agent, is the one who initially shared a Facebook post by Jackson on Sunday that quickly went viral. In it, he wrote on July 8: “In uniform I get nasty hateful looks and out of uniform some consider me a threat. . . . These are trying times. Please don’t let hate infect your heart. This city MUST and WILL get better. I’m working in these streets so any protester, officer, friend, family, or whoever, if you see me and need a hug or want to say a prayer. I got you.”

Those last three words have now become a hashtag: #Igotyou.

On Monday, Louisiana Gov. John Bel Edwards (D) quoted from the Facebook post as he paid tribute to Jackson and the two others killed: Matthew Gerald, 41, a veteran of the Marines and Army who served in Iraq before joining the Baton Rouge police, and Brad Garafola, 45, of the East Baton Rouge Parish Sheriff’s Office.

At the same afternoon news conference, Baton Rouge Police Chief Carl Dabadie recalled the 20 weeks that he served as Jackson’s instructor at the academy, days in which he tested him physically, mentally and emotionally.

“Montrell stood tall every day,” Dabadie said. “He never wavered. He never quit. His heart was in service to his community.”

Dabadie said he visited officers in Jackson’s district a few days ago to lift their spirits amid the tense protests over Sterling’s death and the grief over the deaths of the five Dallas officers.

FROM LEFT TO RIGHT: Baton Rouge Police Officer Montrell Jackson, Baton Rouge Police officer Matthew Gerald, 4, and East Baton Rouge Sheriff's deputy Brad Garafola, 45. (FROM LEFT: Courtesy of Trenisha Jackson via AP; Baton Rouge Police Department via European Pressphoto Agency; East Baton Rouge Sheriff's Office via AP)

“Montrell ended up giving me a pep talk,” he said. “And that was the last time I spoke to Montrell, and I will never forget it. He is a true hero.”

Dabadie read a statement from Jackson’s wife, Trenisha, who lost her husband the day before their son reached the age of 4 months. It began: “Montrell was my everything.”

“He loved his family and he loved his fellow officers,” she wrote. “I know without a shadow of a doubt, he loved his job and his city. Knowing this is what gives me a little peace and comfort. I know he made the ultimate sacrifice and paid the ultimate price in doing what he loved, protecting and serving a city that he loved.”

Godal said that after she shared Jackson’s Facebook post and saw his words being passed around by the thousands, she worried that she had invaded his privacy. She had lived next door to the Jacksons in the Juban Parc subdivision since about 2009, and the 6-foot-3 police officer had served as a mentor to her three sons when their father, Rhett Jeansonne, a Louisiana state fraud investigator, was killed in the line of duty in 2011.

“He would sit out in the driveway for hours talking to them,” she recalled. “To lose someone to murder is such a different pain and grief. It’s different when they’re stolen from you.”

But Godal said her initial fear of betraying her friend’s memory, and possibly upsetting his family, subsided when she saw the reaction his words provoked.

“I hope his death and his words are felt profoundly all over,” she said. “You know how you always look back after someone died, and say, ‘Oh, they were such a great man.’ I told him he was a great man when he was alive.”

She said they would often joke about how he had the best yard or the best flowers or the best awning. She would tell him, “Instead of keeping up with the Joneses, we’re trying to keep up with the Jacksons.”

She kept pressing Jackson to hurry up and have a child so her youngest son, Kooper, could grow up with him or her. They were thrilled when Mason was born in March and put together a basket of gifts for him.

Jackson, she recalled, came over and delivered a thank-you card from the baby to Kooper. When he showed Kooper a photo, the 4-year-old asked, “How in the world did you have a white baby?”

Jackson laughed, Godal said, and assured her son, “Buddy, he’s going to get browner every day.”

For the neighborhood, Jackson created an online space for everyone to talk and often deleted negative comments, Godal said. He wanted to promote unity, not divisiveness.

On Sunday night, more than 50 of his neighbors gathered at a clubhouse for a private candlelight vigil. In his honor, a neighbor had placed blue ribbons on mailboxes a year earlier for another police shooting, and many remained there, suddenly needed again.

When Jackson wrote on his Facebook page about not wanting his son to become a police officer, Godal said she responded as a friend and the daughter of a retired Baton Rouge detective. She didn’t yet know about Sterling’s death. The videos of his shooting outside a convenience store had not yet been shared across the nation, and Black Lives Matter protests had not yet been organized in his name.

“You have an honorable career, you sacrifice to serve our community, unfortunately you will question God and possibly humanity along the way,” she wrote. “Your son will be so proud. . . . And trust me!! He will never want to be a cop but, he sure as hell will respect them.”