PROVIDENCE, R.I. — Father Lukasz Willenberg, a military chaplain who ran in last year's Boston Marathon, decided to make the base where he is stationed in Afghanistan an official extension of the famous 26.2-mile race this year.

And when the race ended, he managed to beat his last year's time while a world away and under unique conditions.

The priest joined more than 500 runners representing all branches of the Armed Forces in the officially sanctioned Boston Marathon Afghanistan. They began running at 3 a.m., under the cloak of darkness necessary to maintain operational security.

"I think I have God on my side," the priest joked after the race in a telephone interview from Afghanistan, noting that his finishing time of 2 hours, 44 minutes and 59 seconds was about 11 minutes faster than his finish last year.

When the runners circled the sprawling Bagram Airfield northeast of Kabul and about 100 miles from the Pakistan border, they also had to contend with the location's 5,000-foot elevation, where the air is thinner than at sea level, and is also filled with dust.

Father Willenberg finished second in the marathon, behind Josh Peterson, a civilian working for the U.S. State Department's Diplomatic Security Service.

"The timing of the race was the most difficult part for me. The 3 a.m. start time really messes with your sleep cycle, so you have to decide whether you want to stay awake, or try to catch some sleep before the race," said Peterson, from Plymouth, Minn., in a phone interview with The Rhode Island Catholic, diocesan newspaper.

Peterson, who ran in the Boston Marathon in 2006, also ran a marathon in Greece in 2012 where runners replicated the route of the first marathon. He said he enjoys running because it gives him a few hours of escape from realities of life in a war-torn country.

Father Willenberg, 32, a native of Poland who was ordained a priest in the Diocese of Providence in 2008, is a veteran runner, who has competed in Ironman and triathlon events.

He ran last year's Boston Marathon so quickly that he even had time to drive back home to St. Luke Parish in Barrington, where he was assistant pastor, to rest before celebrating a confirmation that evening. It was then, as he stretched out on the sofa in the rectory that he heard the news that explosions had torn through the marathon's finish line area killing three and wounding and disfiguring more than 250.

He anxiously telephoned friends who were racers to make sure they were all right.

Days after the race, as Boston began its long healing process, the priest began to think about the next race.

His strong 2013 finish qualified him to run in the 2014 race, but he was planning to enter the U.S. Army in the next few months to serve a four-year tour of duty as a military chaplain.

In January, he was assigned as captain to the U.S. Army's 10th Mountain Division, and he began a one-year deployment with his unit to Bagram Airfield in Afghanistan.

The chaplain presented his idea of a Boston Marathon in Afghanistan to his commanding general, Major General Stephen Townsend, who gave it the green light. Then he petitioned the Boston Athletic Association for permission to host a Boston Marathon outside of the Bay State.

The organization granted only one entity -- the Combined Joint Task Force-10 and Regional Command-East based at Bagram Airfield -- permission to host such a marathon.

The race was advertised strictly through word of mouth to maintain operational security. It took only a few days for more than 600 soldiers and civilians serving all over Afghanistan to sign up for the marathon, held three days before the in-Boston race.

"As we run the first Boston Marathon since last year's bombings, we "run as one" with the people of Boston," Townsend said in a statement the day of the race.

"Like the U.S. Army's slogan, 'Army Strong,' the people of Boston have shown they are tough, they are resilient; they have shown the world they are 'Boston Strong.'"