Nitrogen-containing heterocycles, including 1H-indoles and electron-deficient 1H-pyrroles, undergo a palladium/norbornene-cocatalyzed regioselective alkylation at the C–H bond adjacent to the NH group. A primary alkyl halide is used as the electrophile and the reaction proceeds smoothly under mild conditions to give 2-alkyl-1H-indoles and 2-substituted or 2,3-disubstituted 5-alkyl-1H-pyrroles in good yields.