A method of manufacturing a semiconductor device according to an embodiment includes processing a second film 14 formed on a semiconductor substrate to a pattern including a plurality of linear parts and end portions formed in an end of each of the linear parts, having a width wider than the linear parts, forming a first pattern 16 by slimming the pattern, forming a second pattern including a first opening 180 that traverses the end portion 141a of the first pattern 16, etching the second film 14 exposed in the first opening 180, and dividing the end portion 141a into a first end portion 142a close to the linear part 140a and a second end portion 143a apart from the linear part 140a.