diff --git a/doc/man/nanorc.5 b/doc/man/nanorc.5
index 40e3a645a7a96848a66b4965b19ff3e3f56b32ca..2680047e0173ee7299fba876ad3859a4c8cff77a 100644
--- a/doc/man/nanorc.5
+++ b/doc/man/nanorc.5
@@ -518,7 +518,8 @@ Goes to the first line of the file.
 Goes to the last line of the file.
 .TP
 .B gotoline
-Goes to a specific line (and column if specified).
+Goes to a specific line (and column if specified).  Negative numbers count
+from the end of the file (and end of the line).
 .TP
 .B gototext
 Switches from targeting a line number to searching for text.
diff --git a/doc/texinfo/nano.texi b/doc/texinfo/nano.texi
index fb13582028e28a51333298003c7015076af20cfb..6f26b9941e3b8516502da38e3bac1c94cc374a22 100644
--- a/doc/texinfo/nano.texi
+++ b/doc/texinfo/nano.texi
@@ -1104,7 +1104,8 @@ Goes to the first line of the file.
 Goes to the last line of the file.
 
 @item gotoline
-Goes to a specific line (and column if specified).
+Goes to a specific line (and column if specified).  Negative numbers count
+from the end of the file (and end of the line).
 
 @item gototext
 Switches from targeting a line number to searching for text.
diff --git a/src/search.c b/src/search.c
index 3108ba44f6e2cd34ba6473fc69b96957ff37bd64..0dc3853bae1cf2a30df679fae7f65e2fd0ee4936 100644
--- a/src/search.c
+++ b/src/search.c
@@ -932,11 +932,8 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
 	if (i > 0)
 	    return;
 
-	/* Do a bounds check.  Display a warning on an out-of-bounds
-	 * line or column number only if we hit Enter at the statusbar
-	 * prompt. */
-	if (!parse_line_column(answer, &line, &column) ||
-			line < 1 || column < 1) {
+	/* Try to extract one or two numbers from the user's response. */
+	if (!parse_line_column(answer, &line, &column)) {
 	    statusbar(_("Invalid line or column number"));
 	    return;
 	}
@@ -948,10 +945,24 @@ void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
 	    column = openfile->placewewant + 1;
     }
 
+    /* Take a negative line number to mean: from the end of the file. */
+    if (line < 0)
+	line = openfile->filebot->lineno + line + 1;
+    if (line < 1)
+	line = 1;
+
+    /* Iterate to the requested line. */
     for (openfile->current = openfile->fileage; line > 1 &&
 		openfile->current != openfile->filebot; line--)
 	openfile->current = openfile->current->next;
 
+    /* Take a negative column number to mean: from the end of the line. */
+    if (column < 0)
+	column = strlenpt(openfile->current->data) + column + 2;
+    if (column < 1)
+	column = 1;
+
+    /* Set the x position that corresponds to the requested column. */
     openfile->current_x = actual_x(openfile->current->data, column - 1);
     openfile->placewewant = column - 1;