The district's odd shape is attributed to gerrymandering in order to favor Democratic candidates following the 2000 and 2010 censuses. In 2012 the district was found to be the third least compact congressional district in the United States. However, the district was heavily Democratic even before then; a Republican hasn't held it since 1927.
In 1792 the Maryland 3rd Congressional District was moved to include Montgomery County, Maryland and the eastern half of Frederick County, Maryland. The population was about 33,000. However, the western portion of what is today Carroll County, Maryland was at this point in Frederick County, and the western half of the District of Columbia was in Montgomery County. This latter fact explains why the district lost population even though it in theory did not experience redistricting after the 1800 census. With the population of Georgetown, D. C. no longer in the district, its 1800 population was about 31,000. At this point the 3rd was Maryland's least populous district, barely having half the population of the Baltimore City and County 5th district, which in 1800 had just above 59,000 inhabitants.
The boundaries remained the same after the 1810, 1820 and 1830 censuses. While in 1820 the district had about 36,000 inhabitants its population had risen to 53,622 in 1830. With the formation of Carroll County in the 1830s as well as Maryland falling from 8 to 6 congressional seats, the boundaries of the 3rd Congressional District were drastically redrawn. The only area that remained in the 3rd Congressional District was the part of Carroll County that had been in Frederick County. The 3rd also included Baltimore County and the western half of the city of Baltimore. Its new population was 69,923, 24.5% of whom were black.
In 1853 the 3rd district was redrawn again. The new district consisted of Baltimore County except for the northern and western parts of the county and about the eastern third of the City of Baltimore. The district now had a population of 95,729. In the redistricting following the 1860 census, Maryland was reduced to five congressional districts. The 3rd was moved so that it contained the part of Baltimore that had not been in the 3rd before 1863. It now a population of 130,040. In 1873 the 3rd district was moved again, to be the east side of Baltimore. It now had a population of 120,978.