NEW YORK (Reuters) - The United States should pull its troops out of Afghanistan because the war cannot be won and neighboring Pakistan is funding the Taliban to undermine U.S. interests, the author of a new book says.

Journalist and veteran Afghanistan expert Jere Van Dyk is intimate with the war-torn country, after spending 45 harrowing days in 2008 jailed there and terrified he would be killed.

His new book “Captive, My Time As A Prisoner Of The Taliban,” published by Henry Holt’s Times Books imprint, recounts his experience.

His captivity gave him plenty of time to think about prospects for the military struggle in Afghanistan, where the United States has been bogged down in a messy war since 2001.

“They (the Taliban) will never give in,” Van Dyk told Reuters in an interview, adding, “There is fundamentally no difference between the Afghan Taliban and the Pakistani Taliban -- they are all deep down Pashtuns.”

The Pashtuns live in a series of tribal regions that lie along the mountainous border of Pakistan and Afghanistan.

Van Dyk, who lives in New York, has written for many publications, including The New York Times and The Wall Street Journal, and has traveled in Afghanistan and the region since the 1970s, reporting for CBS, CNN and other broadcasters.

Van Dyk also lived Afghanistan’s mujahideen resistance in the 1980s during their war with the Soviet Union and wrote the book “In Afghanistan: An American Odyssey.”

Van Dyk said Pakistani military sources told him their goal was to use U.S. money to support the Taliban and help them take back Afghanistan, thus spreading Pakistan’s sphere of influence and distracting the Taliban from fighting in Pakistan itself.

“Pakistan is using the Taliban to further their own geopolitical goal, which is to prevent Pashtun nationalism from rising again,” he said.

Pakistan has denied a recent report by the London School of Economics that alleges enduring ties between its intelligence agency and the Afghan Taliban. The report said the agency not only funds and trains Taliban fighters in Afghanistan but is officially represented on the movement’s leadership council, giving it significant influence over operations.

To end the conflict, Van Dyk proposes Washington confront Pakistan. “I would go directly to Pakistan and say, ‘Stop funding the Taliban, stop using American money to kill American soldiers, cease your ultimate goal of taking over Afghanistan .... and then we should pull out,” he said.

“POINTLESS WAR”

“It is a completely pointless war,” he said, adding that Washington should send significant aid to assist rebuilding Afghanistan.

Van Dyk is a consultant on Afghanistan, Pakistan and al Qaeda for CBS News.

After writing his first book on Afghanistan, he worked in the 1980s as a consultant to the State Department and was director of Friends of Afghanistan, a nonprofit which pushed for U.S. support for the mujahideen fight against the Soviets.

“I felt guilty for having done that,” he said, adding, “What I was contributing to was more death and destruction.”

As U.S. military involvement dragged on, that guilt weighed on Van Dyk and he felt he could once again explain Afghanistan to Americans. This time he hoped to write a book showing life in the tribal areas of northwest Pakistan -- a place no Western journalist had been in years.

Drawing on his contacts from the 1980s, some who are now Taliban leaders, he thought he would explore the Pashtun region and report on the state of the Taliban and al Qaeda there.

But as the book’s title makes clear, things went badly and he was taken hostage by the Taliban.

“The Taliban commander led me to believe I could be killed at any moment. It was a roller coaster,” Van Dyk said.

Despite his fears, over the month and a half his captors never beat him but instead often engaged him in debates about politics and religion. “Sometimes we laughed,” he said.

Two years later, Van Dyk says he has no idea why he was held or ultimately released -- perhaps it was for ransom or a prisoner exchange or because he was mistaken for a U.S. spy or his captors used him in a dispute with another faction.

He says he still receives threatening phone calls from Afghanistan and has some fears for his safety. But asked if he would go back to Afghanistan, Van Dyk is uncertain.

“I’d like to go back. I don’t know if I can, or if I should,” he said.