A biotech company plans to announce Tuesday that it has won a patent on a genetically altered bacterium that converts sunlight and carbon dioxide into ingredients of diesel fuel, a step that could provide a new pathway for making ethanol or a diesel replacement that skips several cumbersome and expensive steps in existing methods.

The bacterium’s product, which it secretes like sweat, is a class of hydrocarbon molecules called alkanes that are chemically indistinguishable from the ones made in oil refineries. The organism can grow in bodies of water unfit for drinking or on land that is useless for farming, according to the company, Joule Unlimited of Cambridge, Mass.

“We make very clean, sulfur-free hydrocarbons that drop directly into the existing infrastructure for the production of diesel fuel,” said William J. Sims, the chief executive of Joule. The object, he said, was not to be an alternative for fossil fuels, but “to become a viable replacement.”

Joule said it was the first company to patent an organism that secretes hydrocarbon fuel made continuously, directly from sunlight. Other companies, including Amyris Biotechnologies of Emeryville, Calif., and LS9 of San Carlos, Calif., are working on organisms that will make fuel if fed sugar from corn or cellulosic sources, but Joule’s bacterium does not require any sugar. Another company, Aurora Algae of Alameda, Calif., said Monday that it had developed an algae-based platform for production of fuel, pharmaceuticals and other valuable chemicals.