HAMAM AL-ALIL, Iraq -- After the Islamic State of Iraq and Syria (ISIS) swept into his town nearly three years ago, Mustafa al-Taee resolved to bear witness to the militants' brutal rule by secretly painting what he had seen with his own eyes.

The result was a gallery of horrors: car bombs, dead children, an ISIS defector beheaded in a public square, a former police officer strung up by his legs for hours before being shot dead.

"They committed countless crimes and those crimes needed to be documented," said the 58-year-old grandfather in his home in the northern town of Hamam al-Alil, near Mosul. "There were no journalists, no cameras."

Shuffling through his paintings, he comes to one showing a child with an amputated hand.

Get Breaking News Delivered to Your Inbox

"Because he was starving, this child was going through the garbage, collecting empty Pepsi cans to sell and food leftovers to eat later." A roadside bomb planted by the militants exploded, tearing off his hand and legs.

ISIS militants swept across northern Iraq in the summer of 2014, capturing much of the country's north and west, including its second largest city, Mosul. The militants imposed a harsh and violent version of Islamic law.

Even in the privacy of al-Taee's home, painting was a risky endeavor. The extremist group forbids all independent media, and bans artistic renderings of human beings, which it views as a form of blasphemy.

"I expected them to shoot me at any time," al-Taee said.

In this April 30, 2017 photo, works by the Iraqi painter Mustafa al-Taee are on display, at his home in the northern town of Hamam al-Alil, near Mosul, Iraq. AP

A little over a year ago, a neighbor who had seen him drawing reported it to the militants. They came at night, breaking through his front door and jumping over the outer walls of his home, he said.

A search uncovered a painting of a woman and a car exploding. The car bomb had killed the woman's husband, who had been a soldier with the Iraqi army, in a targeted assassination.

The militants collected his canvases and tools, and took them away to be burned. He was taken to the ISIS morality police, known as the Hisbah, which sentenced him to 30 lashes.

"After 15 lashes I started to cry," he said. "I couldn't feel the next 15."

He was jailed for 15 days, and for a month after his release he was unable to draw or paint.

"I couldn't eat, I couldn't draw. I was scared," he said. But he eventually started again, painting and drawing pictures that illustrated life under the extremists and hiding them in a friend's car. When Iraqi forces drove the militants from Hamam al-Alil late last year, he no longer had to worry about being found out.

Reflecting on the risks he took, he said he couldn't bear to give up his art. It's an addiction, he said, "like smoking is an addiction for others."