A majority of voters support legalizing marijuana, but attitudes differ sharply among age and gender lines, according to a poll released Wednesday by Quinnipiac University.

"With the use of marijuana for medicinal purposes legal in about 20 states, and Washington and Colorado voting this November to legalize the drug for recreational use, American voters seem to have a more favorable opinion about this once-dreaded drug," said Quinnipiac University Polling Institute's assistant director, Peter Brown. "There are large differences on this question among the American people.

The poll found 51 percent of voters support marijuana legalization, while 44 percent oppose it. Two thirds of voters under age 30, and 59 percent of men, favor legalization, while 52 percent of women oppose it. Those over the age of 65 were mostly in opposition, with just 35 percent supporting legalization.

This is the first national Quinnipiac poll on marijuana, making it difficult to measure any change in opinion. Other recent polling, however, suggests that attitudes toward its use have become increasingly permissive over the past years, with legalization starting to amass majority support.

Voters have also come closer to accepting gay marriage, although it remains a divisive issue, according to Quinnipiac. Voters were almost evenly split, with 48 percent supporting same sex marriage and 46 percent opposing it. That represents a significant change from just four years ago, when a July 2008 Quinnipiac poll found it was opposed 36 to 55.

The poll also found that 57 percent of voters think undocumented immigrants should be allowed to stay and seek citizenship. Seven in 10 expressed support for President Barack Obama's plan to help young undocumented immigrants who were brought into the country as children avoid deportation. The plan earned a majority of support among Republicans as well as Democrats and independents.

The Quinnipiac poll surveyed 1,949 registered voters by phone between Nov. 28 and Dec. 3, with a 2.2 percent margin of error.

Related on HuffPost:

Loading Slideshow...
  • Alaska

    Legalized for medical use. <a href="http://www.flickr.com/photos/alanasise/6847095796/" target="_hplink">Flickr: alana sise</a>

  • Arizona

    Legalized for medical use. <a href="http://www.flickr.com/photos/billward/110338154/" target="_hplink">Flickr: Bill Ward's Brickpile</a>

  • California

    Legalized for medical use. <a href="http://www.flickr.com/photos/gerbache/2260207829/" target="_hplink">Flickr: gerbache</a>

  • Colorado

    Also legalized possession by non-medical users. <a href="http://www.flickr.com/photos/dok1/520845832/" target="_hplink">Flickr: dok1</a>

  • Connecticut

    Legalized for medical use.

  • District Of Columbia

    Legalized for medical use. <a href="http://www.flickr.com/photos/bigberto/2770838680/" target="_hplink">Flickr: ~MVI~ (off to coron)</a>

  • Delaware

    Legalized for medical use. Flickr: <a href="http://www.flickr.com/photos/dougtone/7749689644/">Doug Kerr</a>

  • Hawaii

    Legalized for medical use. <a href="http://www.flickr.com/photos/ricardo_mangual/6006230817/" target="_hplink">Flickr: Ricymar Fine Art Photography</a>

  • Illinois

    Legalized for medical use.

  • Maine

    Legalized for medical use. <a href="www.flickr.com/photos/indywriter/2683524563/" target="_hplink">Flickr: indywriter</a>

  • Maryland

    Legalized for medical use.

  • Massachusetts

    Passed ballot initiative for legalized medical marijuana in 2012.

  • Michigan

    Legalized for medical use. <a href="http://www.flickr.com/photos/kayoticblue/213316452/" target="_hplink">Flickr: ckay</a>

  • Montana

    Legalized for medical use. <a href="http://www.flickr.com/photos/csbarnhill/2633187564/" target="_hplink">Flickr: csbarnhill</a>

  • Nevada

    Legalized for medical use. <a href="http://www.flickr.com/photos/http2007/4699361533/" target="_hplink">Flickr: http2007</a>

  • New Hampshire

    Legalized for medical use.

  • New Jersey

    Legalized for medical use. <a href="http://www.flickr.com/photos/paulflannery/4021996652/" target="_hplink">Flickr: psflannery</a>

  • New Mexico

    Legalized for medical use. <a href="http://www.flickr.com/photos/everyskyline/3134662783/" target="_hplink">Flickr: michaelwhitney</a>

  • Oregon

    Legalized for medical use. <a href="http://www.flickr.com/photos/d-powell/2099638403/" target="_hplink">Flickr: digging90650</a>

  • Rhode Island

    Legalized for medical use. Also decriminalized possession of less than one ounce.

  • Vermont

    Legalized for medical use. <a href="http://www.flickr.com/photos/bryanalexander/6129117/" target="_hplink">Flickr: BryanAlexander</a>

  • Washington

    Legalized for medical use. Also legalized possession by non-medical users. <a href="http://www.flickr.com/photos/rose_braverman/6924724331/sizes/l/in/photostream/" target="_hplink">Flickr: Rose Braverman</a>