The camp was established by the Army in 1917 on of land on a mesa north of San Diego. The area included the Miramar Ranch, which had originally been established by newspaperman E. W. Scripps and later sold to the Jessop family. It was Scripps who named the area Miramar, meaning "view of the sea". The new base was named in honor of Brigadier General Stephen W. Kearny, a leader in the Mexican–American War who also served as a military governor of California. Camp Kearny was one of 32 new camps created by the Army in 1917 as a mobilization and training facility for troops on their way to battlegrounds of World War I. The first commander was Major James Stuart McKnight. Army aircraft occasionally landed on the parade ground, but an actual airfield was not established during World War I. After the war, the camp was used as a demobilization center; Joseph E. Kuhn commanded the post until it was closed in 1920. It was largely abandoned after 1920 but was retained by the government for use as a military and civilian airfield. The U.S. Public Health Service used it for a time. In 1927 the Ryan Aircraft Company used the field to weight-test the plane The Spirit of St. Louis which they were then building for Charles A. Lindbergh. During 1929–1930 the facility was known as Airtech Field, operated by the San Diego Air Service Corp.
In 1932 the Navy installed a mooring mast for heliumdirigibles on the base. The mast was used for visits by the Navy's two enormous airships, the USS Akron and USS Macon, each long. The Akron first visited Camp Kearny on 11 May 1932. That mooring ended in disaster when a gust of wind carried the airship upward, killing two ground handlers and injuring a third. However, the Navy continued to use the facility, and the Macon moored at Camp Kearny four times during 1934. The airships were homeported at Moffett Field in Sunnyvale, California, whose civic leaders had won a vigorous public relations battle with San Diego in the late 1920s to become the host of the Navy's airfield for dirigibles. In 1940 the Navy began a series of projects to improve and expand Camp Kearny. By 1941 the base contained more than. On 20 February 1943, the area was commissioned as Naval Auxiliary Air Station Camp Kearny. It had three runways: a asphalt runway mainly used for aircraft parking, and two concrete runways. The primary mission of the base was training pilots in the use of PB4Y Liberators, which were built by the nearby Consolidated Aircraft Company.
In 1934 part of the base was leased to the Marine Corps to use for maneuvers and gunnery ranges. At the beginning of World War II the Marines took over the northern portion of Camp Kearny, which they christened Marine Corps Air Depot Camp Kearny. In 1943 the Marines changed their station name to Marine Corps Air Depot Miramar to avoid confusion with the Navy base. The Marine base was mainly used to process Marine squadrons en route to the South Pacific. At various times it was the headquarters of Marine Aircraft Group 11, Marine Aircraft Group 12, Marine Aircraft Group 13, Marine Aircraft Group 14, Marine Aircraft Group 15 and Marine Air Warning Group 2 before they deployed to the Pacific. The Marines also developed a training base on the grounds of Camp Kearny called Camp Holcomb, named for Major-General Thomas Holcomb who was then commandant of the Marine Corps. By 1940 the number of volunteer recruits was overwhelming the local training base, Marine Corps Recruit Depot San Diego, so the Marines replaced Camp Holcomb with a much larger training base directly east of Camp Kearny which was called Camp Elliott, named for George F. Elliott, a former commandant of the Marine Corps. After the end of the war, the Navy used Camp Kearny for demobilization. On 1 May 1946, the Navy departed Camp Kearny, handing it over to the Marines, and the station became MCAS Miramar. In 1947, the Marines moved to MCAS El Toro in Orange County, California, and Miramar was redesignated as a Naval Auxiliary Air Station, NAAS Miramar, followed by upgrade to full air station status as a Master Jet Base and renamed NAS Miramar.