President Obama threw out the first pitch at a Little League game in Northwest Washington on Monday night. He surprised the young players on his way to a fundraiser. (Reuters)

Jim Wallis, the founder of Sojourners magazine, was preparing to coach his 11-year-old son Jack’s baseball team this week in Northwest Washington when two people he assumed were parents approached him on the field.

Instead, they were White House aides, and they had some surprising news: President Obama was on his way to the game and would arrive in 15 minutes.

“I said, ‘Really? He’s coming here?’ ” Wallis, 64, a pastor who has served on Obama’s faith council, recalled in an interview. He looked at his charges who were holding baseball bats and had not been screened by the Secret Service, and he assumed the president was stopping by on a whim.

“It seemed impromptu,” Wallis said.

In fact, Obama’s appearance Monday evening at the Friendship Park baseball diamond — during which he threw a pitch to a 10-year-old and took photos with the players — was a carefully planned photo op known in White House parlance as an OTR, or “off the record,” stop. Planned in secret, with no warning even to the press corps traveling in the presidential motorcade, the events are designed for Obama to engage in everyday activities with ordinary people, while subtly making a broader point about his political agenda — and usually drawing positive media coverage in the process.

Most commonly, Obama visits a deli or burger joint for a midday meal, as he did when he showed up at Shake Shack on Connecticut Avenue NW with Vice President Biden on Friday to have lunch with four construction workers and talk about investing in infrastructure. Other times, he is attempting to boost the political campaigns of fellow Democrats, such as when he ordered cheesecake at Junior’s restaurant in Brooklyn with then-New York mayoral candidate Bill de Blasio in October a week before de Blasio was elected.

Obama also has been known to reward businesses that support his causes, such as when he visited a Gap store in New York in March after the retailer raised workers’ wages at a time the president is calling for an increase in the federal minimum wage. He plopped down a credit card to pay for sweaters for his daughters and a workout jacket for the first lady — and joked about the newfangled credit card machines at the register.

Administration officials said Obama’s stop Monday evening at the Little League game was a bid to foreshadow his visit to Cooperstown, N.Y., on Thursday, where he is scheduled to visit the Baseball Hall of Fame and deliver remarks about the economic benefits of tourism.

“It’s the national pastime; it’s spring,” White House press secretary Jay Carney said in an interview. “But the purpose of the visit to Cooperstown is to highlight the president’s initiative on tourism in a week where we’re focusing on foreign investment in the U.S.”

The connection between foreign tourists and Danny Ringel, 10, may seem tenuous. Ringel deftly scooped up a pitch from Obama, prompting the president to tell him, “You saved me from grounding.” Obama did not mention any grand economic incentives during his time at the field, which was about 12 minutes before he got back into his limousine.

Reporters traveling with the president, who was on his way to a Democratic fundraiser in Potomac, Md., were unaware of the stop ahead of time and appeared uncertain about the reason for the visit even after they arrived. Some mentioned the upcoming trip to Cooperstown but others — including those from local Washington media outlets who arrived after the president had departed — did not.

Wallis said he suspected there was another reason for Obama’s visit: Carney’s 9-year-old daughter, Della, was playing in another game at the park at the same time with her team, the Royals.

Carney said that was pure coincidence. The White House travel advance team had selected the field earlier in the week, the spokesman said, and he didn’t find out until staff members disclosed it in a planning meeting Monday morning. Carney said he didn’t even tell his wife, television journalist Claire Shipman, who was attending the game with their son, for fear of compromising the security around the presidential stop.

“I try to make her games, so I was going to go anyway,” said Carney, who hitched a ride in Obama’s limo.

Also on the Royals was the son and daughter of “Meet the Press” host David Gregory. The son of former Obama adviser David Plouffe was on the opposing team.

“It’s Washington,” Carney said of the collection of notable names on the field.

The president was a good luck charm for the Tigers and the Royals, which both won their games. Jack Wallis had a double, a triple and a homer, and Della Carney made a stellar catch in left field.

Her father, who stayed at the game as Obama went on to the fundraiser, watched proudly.

Colby Itkowitz contributed to this report.