diff --git a/CHANGELOG b/CHANGELOG
index 7572b6af151a400cd8ddf6bdd8f89a604dba8b13..b31fad1d3de22a522fd5f61e6df2b73a38b22add 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -31,6 +31,7 @@ v 8.5.0 (unreleased)
   - Prevent parse error when name of project ends with .atom and prevent path issues
   - Mark inline difference between old and new paths when a file is renamed
   - Support Akismet spam checking for creation of issues via API (Stan Hu)
+  - API: Allow to set or update a merge-request's milestone (Kirill Skachkov)
   - Improve UI consistency between projects and groups lists
   - Add sort dropdown to dashboard projects page
   - Fixed logo animation on Safari (Roman Rott)
diff --git a/doc/api/merge_requests.md b/doc/api/merge_requests.md
index 85ed31320b9e57a43b8fc15f2620510a59213ae2..7e732b9a2b456db7570418cfa3d7e57585877bee 100644
--- a/doc/api/merge_requests.md
+++ b/doc/api/merge_requests.md
@@ -225,6 +225,7 @@ Parameters:
 - `description` (optional)       - Description of MR
 - `target_project_id` (optional) - The target project (numeric id)
 - `labels` (optional)            - Labels for MR as a comma-separated list
+- `milestone_id` (optional)      - Milestone ID
 
 ```json
 {
@@ -277,6 +278,7 @@ Parameters:
 - `description`                 - Description of MR
 - `state_event`                 - New state (close|reopen|merge)
 - `labels` (optional)           - Labels for MR as a comma-separated list
+- `milestone_id` (optional)     - Milestone ID
 
 ```json
 {
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index dd7f24f32791fe5115572fbacfde8ead3db5ca1f..c54beb00ac56d978f5bf5e1c6002d757158ebca3 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -71,6 +71,7 @@ module API
       #   title (required)         - Title of MR
       #   description              - Description of MR
       #   labels (optional)        - Labels for MR as a comma-separated list
+      #   milestone_id (optional)   - Milestone ID
       #
       # Example:
       #   POST /projects/:id/merge_requests
@@ -78,7 +79,7 @@ module API
       post ":id/merge_requests" do
         authorize! :create_merge_request, user_project
         required_attributes! [:source_branch, :target_branch, :title]
-        attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id, :description]
+        attrs = attributes_for_keys [:source_branch, :target_branch, :assignee_id, :title, :target_project_id, :description, :milestone_id]
 
         # Validate label names in advance
         if (errors = validate_label_params(params)).any?
@@ -163,11 +164,12 @@ module API
         #   state_event                 - Status of MR. (close|reopen|merge)
         #   description                 - Description of MR
         #   labels (optional)           - Labels for a MR as a comma-separated list
+        #   milestone_id (optional)     - Milestone ID
         # Example:
         #   PUT /projects/:id/merge_requests/:merge_request_id
         #
         put path do
-          attrs = attributes_for_keys [:target_branch, :assignee_id, :title, :state_event, :description]
+          attrs = attributes_for_keys [:target_branch, :assignee_id, :title, :state_event, :description, :milestone_id]
           merge_request = user_project.merge_requests.find(params[:merge_request_id])
           authorize! :update_merge_request, merge_request