club initially played in the Dumfries and District Junior League. Period in English football The following year, the club moved to the Carlisle and District League. This was despite the club being based in Scotland, albeit very close to the Anglo-Scottish border. They remained in this league for all but one season until 1982, when the club moved to the newly created Second Division of the Northern League. The club won this league and were promoted immediately, before back-to-back championship wins in the First Division, in 1990–91 and 1991–92, resulted in their promotion to the first division of the Northern Premier League. During this period, the club featured in the FA Cup, becoming the first club based in Scotland to appear in the competition proper since Queens Park in 1887. They managed to take Rochdale to a replay in 1991 and gave Bolton Wanderers a scare in 1993 before being beaten. The club saw its future in Scottish football and applied twice to join the Scottish League in 1993 and 1999. To help boost their later application, they played a Rangers XI in a game to raise money for victims of the Lockerbie bombing. Gretna won 2–1 against a strong team. Period back in Scottish football Rapid rise through the leagues In 2002, Gretna were elected to the Scottish Football League at the third attempt, taking the place of Airdrieonians. The club was soon taken over by Brooks Mileson and with his financial input Gretna's on-field fortunes improved. Gretna won the Division Three, Division Two and Division One titles in successive seasons from 2005 to 2007. During their seasons of successive promotions they scored 297 goals, 130 in the 2004–05 season alone. Gretna were also runners-up in the 2006 Scottish Cup. Gretna's 3–0 win in the semi-final against Dundee made them the first team from the third tier of Scottish league football to reach the final. Gretna lost to Heart of Midlothian in the final on penalties after a 1–1 draw. As Hearts had finished second in the Scottish Premier League and had therefore qualified for the UEFA Champions League, Gretna became the first team from the third tier of the Scottish league to qualify for the UEFA Cup. Gretna faced League of Ireland side Derry City in the second qualifying round, but lost 7–3 on aggregate, losing the first leg 5–1 at Fir Park, Motherwell (Raydale Park was deemed