ALBANY  Gov. David A. Paterson was acting within his powers when he issued an executive order requiring government agencies to recognize same-sex marriages performed outside the state, a court ruled on Tuesday.

The decision, issued by Justice Lucy A. Billings of State Supreme Court in the Bronx, a trial-level court, is the latest in a string of rulings by state courts that have upheld the right of same-sex couples who were married in other jurisdictions to have their marital status recognized in New York, even though gay couples may not marry within the state. A bill to allow gay unions passed the State Assembly last year but has not come up for a vote in the Senate.

The suit was filed in June by lawmakers who opposed the governor’s order and by other opponents of same-sex marriage, who argued that Mr. Paterson had effectively usurped the Legislature’s role by issuing the order. The governor said the order, issued in May, was made to protect the state from litigation by gay couples legally married in places like Canada or Massachusetts.

But in her decision to dismiss the suit, Justice Billings rejected the plaintiffs’ reasoning, finding that Mr. Paterson’s order was consistent with state laws that generally require officials to recognize marriages from other jurisdictions and are silent on whether gay marriages should be excluded from that recognition.