Postal workers demonstrated at Staples stores nationwide Thursday to protest a recent U.S. Postal Service deal that allows the office-supply chain to operate USPS retail counters at some of its locations as part of a pilot program.

The financially struggling Postal Service said its agreement is part of a plan to increase convenience and boost business through new partnerships. The agency also has contracted with Amazon to provide package deliveries on Sundays for the online retailer.

Labor groups say the Staples deal represents a shift toward privatization for the USPS. They accuse the agency of jeopardizing mail security and supporting low-wage employment over dependable union jobs.

“The people of this country should have their postal services performed by postal employees — well-trained, in uniform, under the code of ethical conduct and accountable for protecting the sanctity and security and privacy of the mail,” said Mark Dimondstein, national president of the American Postal Workers Union. “That doesn’t happen when the mail is not in the mail system.”

Dimondstein added that the Staples deal makes little sense in light of the retailer’s recent struggles. The company announced in March that it would close 225 stores in an effort to trim costs amid weakened sales.

The Postal Service has defended its Staples agreement, denying that the agency is developing broad plans for privatizing post-office work.

“This retail partnership program could be an innovative step towards generating revenue to ensure the long-term viability of the Postal Service,” the agency said in a statement.

The Postal Service had a loss of $5 billion in 2013 despite posting its first revenue gain in five years. The unions claim that loss is mainly due to a 2006 congressional mandate that requires the agency to prefund its retirement benefits at a cost of about $5.6 billion a year.

Lawmakers from both parties have proposed plans to restructure the payments, as requested by both labor groups and the USPS. But Congress for the past several years has failed to pass postal-reform bills that would have achieved that goal.

Under the retail partnership, Staples employees operate new Postal Service counters in 82 locations, offering USPS products such as stamps, mail services and package delivery. The first openings are taking place in five regions: San Francisco, Atlanta, Pittsburgh, San Diego and Worcester, Mass.

USPS window clerks complete 32 hours of classroom training and 40 hours of work alongside experienced employees before taking on their roles. The unions say Staples requires nowhere near that amount of preparation.

For unions, the debate over the Staples partnership feeds concerns about a possible decline of middle-class jobs in the United States.

Dena Briscoe, 54, a third-generation postal employee who works as a clerk at a USPS station in Capital Heights, said the Staples deal is a bad sign for the future of post-office employment. “I’m concerned about those who come behind me,” she said. “They might not have the type of opportunity that I’ve had to be here 34 years and being able to have a career and livable wages and benefits.”

A Pew Research/USA Today poll this year found that 40 percent of Americans identify themselves as middle class, compared with 49 percent in 2012.

The APWU filed a complaint with the National Labor Relations Board last year alleging that the Postal Service failed to disclose information about the Staples deal in violation of federal labor law. The USPS contends the agreement is proprietary and therefore not subject to release.

The NLRB found merit in the union’s claim and issued a complaint against the USPS in February. The two sides are expected to file legal briefs with an administrative law judge in May.

The Postal Service released a copy of the Staples agreement at an NLRB hearing this month, but the agency redacted much of the information in the document, including entire pages. The APWU has continued its case, claiming the USPS disclosure was inadequate.

Thursday’s demonstrations took place at more than 50 Staples stores, including locations in the District of Columbia, Baltimore and Richmond. Members of the APWU, the National Postal Mail Handlers Union and the National Association of Letter Carriers took part in the Washington event, which drew more than 100 participants.

Representatives of the American Federation of Government Employees, the American Federation of Teachers and the International Brotherhood of Electrical Workers also joined the demonstration as a show of solidarity for unionized workers.

The California Federation of Teachers plans to vote Monday on a proposal to boycott Staples over the retailer’s deal with the Postal Service. Staples receives a substantial portion of its revenue from the sale of school supplies, according to union officials.