SAN FRANCISCO  A legal dispute involving model railroad hobbyists has resulted in a major courtroom victory for the free software movement also known as open-source software.

In a ruling Wednesday, the federal appeals court in Washington said that just because a software programmer gave his work away did not mean it could not be protected.

The decision legitimizes the use of commercial contracts for the distribution of computer software and digital artistic works for the public good. The court ruling also bolsters the open-source movement by easing the concerns of large organizations about relying on free software from hobbyists and hackers who have freely contributed time and energy without pay.

It also has implications for the Creative Commons license, a framework for modifying and sharing creative works that was developed in 2002 by Larry Lessig, a law professor at Stanford.