A 31-year-old father of three obsessed with fitness and sex, Mohamed Lahouaiej Bouhlel led multiple lives. His darkest side appears to have been his best-kept secret: a calculated, committed jihadi ready to kill scores of people in a French Riviera rampage.

Information emerging from authorities and people who knew him suggests Bouhlel concealed his different worlds from each other, and may have been following ISIS guidance to blend in and hide his radicalism while he plotted violence.

There was his family life — three children under six, including an 18-month-old born just after his wife split with Bouhlel, accusing him of frequent abuse.

Then there was his erratic social life: smoking pot with acquaintances in the Tunisian immigrant community; martial arts training and possible steroid use to bulk up muscle; salsa dancing to pick up women; and a reported male lover in his 70s.

And now, it appears that Bouhlel had an extremist life, too, built up over months as he prepared for the Bastille Day attack.

The apartment of Mohamed Lahouaiej Bouhlel is photographed through a hole in the wall made by police, in Nice, southern France, on July 16. (Luca Bruno/Associated Press)

His parallel worlds are complicating investigators' efforts to figure out who he was, who might have helped with the attack, whether other violence was planned. They may never have a definitive answer: Bouhlel was killed by police after ramming his truck through a family-filled crowd enjoying fireworks.

Radicalization went unnoticed

Authorities initially said Bouhlel had radicalized very quickly. Family and neighbours described him as indifferent to religion, volatile and prone to drinking sprees.

But on Thursday, Paris Prosecutor Francois Molins said investigators found images in Bouhlel's phone suggesting he was premeditating an attack as far back as a year ago.

Molins said Bouhlel studied Captagon, a drug used by some jihadis before attacks. He had a screenshot of a previous vehicle attack in a crowd. He obtained weapons through a string of acquaintances.

Authorities say Bouhlel drew inspiration from ISIS propaganda, though there is no sign the attack was directed by the extremist group's bases in Syria or Iraq.

Yet his turn to extremism went unnoticed by relatives, neighbours and acquaintances. And police and prosecutors investigating Bouhlel for a road rage incident in early 2016 saw no reason to flag him as a potential risk.

Gym friends didn't know about family

A French security official said this may have been intentional, in response to ISIS suggestions to some followers in the West that they hide their radical faith to stay off police radar. Attackers who targeted Paris and Brussels in 2015 and 2016 are believed to have done the same.

A lawyer for one of five suspects given preliminary terrorism charges in the case says he believes Bouhlel radicalized alone.

Lawyer Jean-Pascal Padovani said his client, Ramzi A., and Bouhlel were from the world of "small-scale delinquence. ... They smoked pot together. It was that kind of relationship."

French hooded police officers leave the building where Mohamed Lahouaiej Bouhlel lived. (Luca Bruno/Associated Press)

Ramzi was on Nice's seaside Promenade des Anglais the night that Bouhlel's truck careened down the cordoned-off boulevard. But his lawyer insists he was there to have fun, and had no idea what Bouhlel planned to do.

Vladis Selevanov, who works as a cook in Nice, said he had gone to different gyms with Bouhlel for about four years, yet didn't know he was married and a father. Selevanov and others who worked out with Bouhlel described him as a loner. "He was strange, but not at all aggressive."

Guys at the gym nicknamed him "Arnold," as in Schwarzenegger, because he was so muscular, yet he had an incongruously high-pitched voice. He seemed obsessed with his appearance, always clean-shaven, hair gelled backward even during workouts — and was always wearing flip-flops, Selevanov said.

'Unbridled sex life'

Bouhlel used his two middle names when he signed a petition to get their gym to stay open until 11 p.m.. When he discovered it offered salsa lessons, he joined with gusto, Selevanov said, bragging about how it was a good way to meet women. "He always hit on all girls, old, young," Selevanov said.

Bouhlel also performed at salsa nights at the Restaurant de la Victorine near the Nice airport, according to people who worked there, and trained in a smattering of martial arts, leaving the impression of a strong but somewhat undisciplined fighter.

His opponent in a 2010 karate tournament described him as a novice, making mistakes because he was stressed and not a seasoned fighter.

A video of the fight, obtained by The Associated Press, shows Bouhlel sparring powerfully, and occasionally going overboard — at one point head-butting and at another kneeing his opponent in the crotch. Between each round, Bouhlel respectfully bowed.

Still taken from video made available Wednesday July 20, 2016, showing Nice, France, attacker Mohamed Lahouaiej Bouhlel, right, while competing in a martial arts competition in 2010. His opponent, who asked not to be named, said he remembers Bouhlel as an novice who repeatedly made mistakes during the fight, saying he would strike with his head and elbows, which is banned by the rules. (The Associated Press)

A man who trained Bouhlel in Satori martial art described Bouhlel as always polite and calm, yet he was fired from a delivery company for inappropriate behavior.

The opponent and the trainer spoke on condition of anonymity out of concern for their security.

Selevanov said Bouhlel was known to have had a long-term relationship with a male gym-goer in his 70s. The prosecutor said he had an "unbridled sex life."

Selevanov described working out on a treadmill with Bouhlel a few weeks ago in the Moving Express gym, in a neighborhood near Nice's renowned Marc Chagall Museum, when he found him unusually friendly.

"He came up to say 'Hi, how's it going?"' Selevanov said in an interview. "I couldn't believe it when I heard (what happened July 14). We are shocked. Completely shocked."