A few weeks after Richard Perry and his family moved into their Bowie home, a stranger knocked on the door.

“Would you like to sell your house?” the woman asked. “I see that it is in foreclosure.”

Perry was stunned. Before moving in, he and his wife had been assured that the title to the house was clear.

Perry shooed the woman away but then tried to figure out what was going on. He soon discovered that a lien had been slapped on his house not long after he bought it in 2004, to collect a $3,000 unpaid debt owed by the previous owner. That lien, he soon discovered, had thrown the house into foreclosure. And the debt was for something called a “front foot benefit charge.”

Dozens of other homeowners, mostly in Prince George’s County, have lodged similar complaints to a legislative panel that has been meeting in recent months to examine the charge, which has left some owners with unexplained and unexpected charges that has made it more difficult to afford their homes.

The charge is assessed for the installation of pipes that connect new homes to the public water and sewer system. But in 1998, the Maryland General Assembly changed the law for Montgomery and Prince George’s counties to allow developers, rather than the public water and sewer commission, to lay the pipes, and then charge homeowners for the work. Previously the Washington Suburban Sanitary Commission, which serves the two counties, did the work and charged homeowners.

State Sen. Douglas J.J. Peters (D-Prince George’s) began hearing complaints about the charge from constituents in new developments as he walked his district in the summer of 2011. Many said they did not understand the charge, how it was calculated or how much interest they were paying.

The amount of the charge can vary from neighbor to neighbor, and the relationship of the charge to the actual cost of installing the water and sewer lines is rarely disclosed. There is no legal requirement to provide that information to the homeowner, Peters’s panel learned.

“There is no clearinghouse for these developers; there is no registry,” Peters said.

“You have what I call a huge mystery in terms of these fees. Most people want to know what they are paying, why they are paying what they are paying, why my fee is $600 and that other person’s is $1,400,” he said.

Peters said he plans to introduce legislation next year to try to smooth the process. He hopes to require more disclosure of costs for installation, interest rates, and any discount available to homeowners if they can pay off the charge early.

Stanley Okumura, a resident of the Victoria Falls retirement community in South Laurel, said the current system in the two counties is really no system at all. He said that some homeowners in his development were charged $800 a year, and others who moved in later to the same type of home were charged $1,500 a year, for 30 years.

“There is no real review or an approval process for the actual cost incurred,” he told Peters’s panel. “This opens the door for fraud, abuse and overcharges.”

The system evolved after developers complained that the WSSC moved too slowly to install the pipes. The WSSC, eager to reduce its bond indebtedness to maintain a high rating, did not object to turning the job over to developers, agency officials said. In other jurisdictions, such as Anne Arundel County, private developers for years have installed the pipes and assessed the fees but are required to explain the process and fees in detail.

Mark Kestner, a lawyer in Rockville who has studied the charge, said it is nicknamed the “developers’ retirement account. . . . The developers certainly make it worth their while,” he said. The typical interest rate, according to Kestner, is about 8 percent, far more than most mortgage rates. “That is a pretty good return on your money,” he said. “But somebody has to pay for this infrastructure,” he added. Some new real estate contracts now voluntarily disclose the front foot charge, he said.

Peters said he also has heard of instances in which a house is resold and the developers will reset the fees, charging anew for an additional two to three decades, long after costs have been recovered.

Frank Connors, a member of Peters’s task force and chief financial officer of EYA, a developer, said he favors requiring developers to provide more information, something he says EYA already does.

“It is the right thing to do. Anyone who says ‘don’t disclose,’ help me with that logic. And if it is bogus, you should not be charging. You should not be charging people for stuff you don’t incur,” he said in an interview.

For Perry, figuring out how to manage the surprise expense has been a challenge. He consulted private attorneys but decided that trying to sue might cost more than simply paying the front foot charges.

Perry was able to get the title company that had missed the $3,000 front foot debt to pay it off. But that still left him on the hook for $1,150 a year for the front foot charge for at least the next 23 years. Had he known about the expense when he was purchasing the house, he said, he would have either not bought the house, or rolled the front foot charge into his monthly mortgage payments.

Celeste Brannon and her husband also were taken by surprise when they learned a few days before they were to close on their new house in Bowie in 2007 that they would have to come up with an additional $33,000 over the next two decades to pay for the pipe connection.

“The whole thing was crazy,” said Brannon, who decided to pay off the fee with a lump sum.

Peters said he is optimistic that the General Assembly will take steps to ensure more disclosure.

“We have got to get our arms around the situation,” he said.