In this work, an electrogenerated chemiluminescence (ECL) sensor was fabricated to detect silver ions based on the competitive interaction between luminol, silver ions and cucurbit[6]uril (Q[6]). The Q[6]-modified electrode (Q[6]/GCE) exhibited the best electrochemical response among various Q[n]-modified electrodes and was selected for ECL measurements. Strong anodic luminol ECL was obtained at the Q[6]/GCE due to the interaction between luminol, oxygen, and Q[6]. In the presence of Ag+, the strong coordination interaction between Ag+ and Q[6] could decrease the concentration of luminol and oxygen on the electrode surface, resulting in a decreased ECL signal. The variation of the ECL intensity was linearly correlated with the Ag+ concentration. Therefore, an ECL sensor for the quantitative detection of Ag+ was proposed. Under the optimal conditions, Ag+ can be detected in the range of 10 nM to 5 mu M, and the detection limit was calculated as 8.2 nM (3 sigma). The proposed ECL sensor shows outstanding specificity and accuracy, indicating that cucurbit[n]urils have great potential applications in the detection of metal ions.