Afternoon sunlight streamed through the front door of a Baltimore rowhouse where a gaunt man sat before an open suitcase filled with mementos of war and solitude.

Bits of shrapnel. Ragged green flags with burn marks. An Italian-made lock that had secured the door of a one-man prison cell. Now, in his childhood home, Matthew VanDyke held each one up.

A tattered empty milk carton had provided him reading material in solitary confinement. “This is the best milk box I ever got,” he said. “It’s from Germany, and it has five languages on it.”

During the months after VanDyke, 32, disappeared on the frontline of Libya’s revolution, some people tried to gently tell his mother to expect the worst. Other missing Westerners — usually journalists who had mistakenly gotten too close to the action — had been found. But despite the efforts of diplomats and rights organizations, there was no trace of VanDyke.

He had left Baltimore in February, a few days after the uprising against Moammar Gaddafi started, telling his mother and girlfriend that he wanted to document it for a book and film.

But he really went to Libya to fight.

“I had friends there,” he said. When they e-mailed asking him to tell people about them if they died, he decided to go help them.

He arrived in Benghazi, where a friend, once a hippie, was now a fighter. VanDyke told him, “I’m really here to fight; give me a Kalashnikov.” He was given a uniform, plus a hat and sunglasses that helped him blend in.

Six days later, he was captured by Gaddafi forces while on a reconnaissance mission. He was knocked out and has no memory of what befell him or his three companions, who haven’t been found.

After seeing photos of VanDyke with ammunition and videos of him vowing to fight until Libya was free, an interrogator told him, “You’ll never see America again.”

In his cell, he marked the days with scratches on the wall. He sang Guns N’ Roses songs to himself and tried to remember all the characters from “Star Trek.” He scraped his fingernails and toenails down to nubs, in case the guards tried to pull them out the way they had to the George Clooney character in “Syriana.” Sometimes, he thought about suicide.

Five and a half months passed.

In August, Tripoli’s notorious Abu Salim prison was liberated, and VanDyke walked out. Disoriented, unaware that NATO had intervened in the rebels’ favor, he briefly recovered in Tripoli.

Then, instead of taking the flight home arranged by the State Department, he joined a rebel brigade fighting in Sirte, Gaddafi’s home town. He pledged to stay until the Libyan dictator was vanquished. The organizations that had spent months searching for him said they would not look for him if he disappeared again.

VanDyke knows some people don’t understand. He has already begun to hear their voices — journalists who greeted him at the airport Saturday night asking what he had to say to government officials who made such efforts to find him; radio and online commenters who have called him a leftist fighting alongside al-Qaeda, or a Zionist.

“I don’t live my life worried about what people are going to say when I’m there to help my friends and to overthrow a dictator, who also killed a lot of Americans, Gaddafi, and also people all over the world he was the — Misty! Hey, Misty!” An orange tabby appeared in the doorway. “Misty, do you remember me?”

With piercing blue eyes, long hair pulled back in a ponytail, hollow cheeks and a full beard, he looked like Rasputin. His mother, Sherry, blond and bespectacled, neatly folded his rebel flags. She brought him ice water and jalapeno cheese cubes and quietly basked in his presence as he unpacked. “I always knew he was alive,” she said.

The next time he flies away, she said, “I’ll drive him to the airport again.”

His girlfriend, Lauren Fischer, is not so sure. VanDyke’s excursions caused friction between them before he left, and he has promised he will stay in the United States for at least three months.

He plans to work on a book about his experiences and regain the 20 pounds and muscle mass he lost in prison. When he went to church Sunday, his pants were sliding off his hips. Fischer arrived at his house later with two belts from the Gap.

With a touch of a Maryland drawl, VanDyke said he doesn’t know why his actions seem strange to some. “Gaddafi was probably the most active sponsor of international terrorism ever . . . I didn’t think there would be a problem, and I really didn’t care very much if it was, because I was doing the right thing,” he said.

Comparing himself to foreigners who fought in the Spanish Civil War, he added, “Why don’t more people do it?”

VanDyke, who holds a master’s degree from Georgetown University’s Walsh School of Foreign Service, had always planned to get overseas one way or another. He had wanted to work for the CIA, but his anxiety caused him to fail the polygraphs. He had considered joining the Marines or the Green Berets but ultimately decided to ride a motorcycle through North Africa and the Middle East. The idea was to get to know people in war-torn countries, and to conquer the fears that sometimes paralyzed him.

During the fighting in Libya, the obsessive-compulsive disorder that had plagued him since his teenage years subsided. He no longer worried so much about trash, sugar or striking a pedestrian while driving. Life took on a sharper edge.

It wasn’t that he liked war. But “when it became more routine and more like my existence, that combined with just the camaraderie of the other fighters . . . and the constant unpredictability of it, and being part of something that important, all of those things combined made it like the best time of my life,” he said.

It is not a life he is ready to relinquish. He landed at BWI Saturday night wearing Libyan military fatigues and a kaffiyeh, the traditional Arab headdress (he arrived late, having been questioned by Homeland Security in New York just long enough to miss his flight). He told reporters he planned to train for combat in future Arab revolutions.

Some of his suitcase’s contents were sentimental: his navy blue prison uniform, a purple kaffiyeh given to him by a friend who disappeared in the ambush, a wad of dinars that a fellow prisoner gave him after their release.

Others were trophies: giant laminated posters from the conference hall that had been a showpiece for Gaddafi, coffee saucers from the dictator’s house in Ras Lanuf.

A day after his return, some things were already back to normal. His OCD had returned. A neighbor popped in with a pumpkin pie and confessed that she had been planning a few months ago to give Matthew “a good hard slap” when he got home.

But there was no slapping now. There was the girlfriend who had grabbed his hand at the airport and wouldn’t let go. And there was his mother in the kitchen, preparing lobster tails and Alaskan snow crab for dinner.