Wal-Mart is experimenting with same-day deliveries in Northern Virginia, offering a service that Amazon.com has begun piloting elsewhere in the country.

The Walmart to Go test program, an offshoot of an earlier grocery-delivery service offered in San Jose, began in Northern Virginia on Oct. 2. It has since been expanded to Philadelphia and Minneapolis and will be rolled out in San Jose and San Francisco in coming weeks.

Customers can buy nearly 5,000 items — personal computers, furniture, bath towels, even gun-cleaning kits — for home delivery. The orders are fulfilled at area Wal-Mart stores and delivered by the United Parcel Service.

“Connecting our Web site with 4,000 physical stores across the country really gives us a leg up,” said Ravi Jariwala, a spokesman for Wal-Mart.

The initiative comes as the retailing giant faces increasing competition from Internet stores. Amazon.com offers same-day delivery in 10 cities, including the District and Baltimore, for orders placed before 11 a.m. There is a starting fee of $8.99.

At Wal-Mart, orders must be placed by noon. Customers are given four-hour delivery windows between 4 p.m. and 10 p.m. when their items will be delivered for a flat fee of $10.

Northern Virginia, which is home to dozens of Wal-Mart stores, was the first test market for the company’s new program.

“We had to make sure that we picked markets where we had a large presence of stores,” Jariwala said. “I don’t know that there was any other reason — it’s not that we liked the motto ‘Virginia Is for Lovers,’ or anything like that.”

Wal-Mart’s share prices have been ticking up in the past year as economic uncertainty globally has led investors to bulk up on shares of discount retailers. The company’s shares closed at $74.14 on Tuesday, a 38 percent increase from one year ago.

In a recent study conducted by Wal-Mart, Jariwala said a majority of respondents said they would consider same-day delivery if it was available.

“That gave us a sense that there is some demand for this,” Jariwala said. “There was a lot of interest for general merchandise like electronics, video games and toys.”

Jariwala would not comment on many of the logistics involved — how a store’s products are rounded up for delivery, for example, or whether there was a threshold for how many deliveries the company could handle on any given day.

“We’re really intent on learning from customers [during] this test run,” he said.

Wal-Mart has been making efforts to link online shopping to its stores in recent years, with free ship-to-store options.

Earlier this year, it began allowing customers to pay for online orders at local Wal-Mart stores using cash or debit cards.