Gatto won by 17.3 percentage points, receiving 58.7 percent of the vote to Ramani's 41.4 percent, in the Assembly's 43rd District, which covers Glendale, Burbank and North Hollywood.
Gatto, an attorney and former aide to Rep. Brad Sherman, D-Sherman Oaks, and Ramani, owner of an interior-construction company, were vying to serve in the Assembly through the Nov. 30 expiration of the term that Paul Krekorian gave up in January after being elected to the Los Angeles City Council.
Gatto's swearing-in is expected to occur soon after county officials certify the election results, probably in early July.
Gatto, 35, and Ramani, 49, actually faced the voters twice Tuesday, appearing on a separate page on the ballot in their parties' primaries for the Nov. 2 election for the next full two-year term. Both advanced easily, setting up a rematch in the general election.
Ramani was the only Republican in the primary. Gatto received 81.1 percent of the vote in the Democratic primary, distancing opponents Nayiri Nahabedian and Chahe Keuroghelian, both of whom stopped campaigning for the primary after losing in the April 13 special election for the unexpired term.
Analysts saw the race to fill Krekorian's incomplete term as Gatto's to lose. The Democratic Party enjoys a nearly 2-1 advantage in voter registration in the 43rd District. Democrats Scott Wildman, Dario Frommer and Krekorian won the past six Assembly general elections by margins of 17.6 to 53.2 percentage points.
But Ramani advisers expressed optimism in the days before the election, saying they expected Republican voters to turn out in higher proportion than usual, drawn to the polls by big GOP primary races for governor and U.S. Senate.
And Ramani described himself as "excited" when the early vote-by-mail returns Tuesday showed him trailing Gatto by only about 7 percentage points. Gatto's lead, though, expanded as the night went on.
The Ramani campaign tried to portray their man, a native of India who graduated from Cal State Northridge, as a community-spirited political neophyte with a simple agenda of encouraging job creation by freeing small business from taxes and regulations.
"We have too many priorities in this state," Ramani said at one point.
Responding to Ramani's focus on helping small business, Gatto remarked: "I think the average Californian feels there are more issues than just one."
Ramani painted Gatto as politically ambitious, noting the Los Angeles native made his first run for office when he was a UCLA undergraduate, losing a primary race for the 46th District Assembly seat in 1996.
Seeking to dilute the possible disadvantage in being seen as a political "insider," Gatto argued he knew better than Ramani "how state government works," and touted his work to directly help constituents when he was a Sherman aide.
Ramani supporters accused Gatto of underhanded tactics.
They eagerly spread the word when a Glendale resident — who denied allegiance to either campaign — filed a complaint with the state Fair Political Practices Commission in May that included the allegation Gatto backers paid for Keuroghelian to run in the April special election to try to draw the district's many Armenian votes away from Nahabedian.
Gatto denied having colluded with Keuroghelian. The FPPC said it will investigate.